我收到此错误,但我不明白为什么:
*由于未捕获的异常“NSRangeException”而终止应用程序,原因:“-[__ NSCFArray objectAtIndex]:索引 (171053968) 越界 (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");
}
}
}