*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray exchangeObjectAtIndex:withObjectAtIndex:]: index 16 beyond bounds [0 .. 3]'
我洗牌標籤值的陣列碼,
words = [[NSMutableArray alloc] initWithObjects:@"1", @"2", @"3",@"4", nil] ;
NSUInteger count = [questar count];
for (NSUInteger i = 0; i < count; ++i) {
// Select a random element between i and end of array to swap with.
NSInteger nElements = count - i;
NSInteger n = (arc4random() % nElements) + i;
[words exchangeObjectAtIndex:i withObjectAtIndex:n];
}
,我應該做出什麼樣的變化?任何一個可以幫助我解決
在哪裏'count'變量定義了嗎? – Eimantas
@Eimantas對不起。現在問題更新 –
什麼是questar? – Ilanchezhian