このエラーが発生しましたが、理由がわかりません:
*キャッチされない例外 'NSRangeException' が原因でアプリを終了します。理由: ' - [__ NSCFArray objectAtIndex ] : index (171053968) beyond bounds (226)'
- (void)makeArrayOfGrade{
BOOL *alreadyAdded;
for (int a = 0; a <= [allData count]-1; a++) {
NSIndexPath *path = [NSIndexPath indexPathForRow:a inSection:0];
NSDictionary *dict = [allData objectAtIndex:path];
if ([[dict objectForKey:@"grade"] isEqualToString: @"5 класс"]) {
/* for (int i = 0; i <= [allData count]; i++){
NSIndexPath *inPath = [NSIndexPath indexPathForRow:i inSection:0];
NSDictionary *inDict = [allData objectAtIndex:path];
if ([dict objectForKey:@"subject"]==[inDict objectForKey:@"subject"]) {
added=YES;
}
}
}
if (added==NO) { */
[dataForEachGrade addObject:dict];
NSLog(@"added");
}
}
}