我试图在 tempArray 中添加只有偶数个 data.localBookmarks 是字典数组。这是我的代码:
currentIndex = indexPath.row;
for (NSDictionary *dict in localBookmarks)
{
if (currentIndex % 2 == 0 && currentIndex <= [localBookmarks count])
{
[tempArray addObject:[dict objectForKey:@"firstName"]];
}
currentIndex++;
}
NSLog(@"tempArray %@",tempArray);
cell.textLabel.text = [tempArray objectAtIndex:indexPath.row];
return cell;
我的应用程序在 [tempArray addObject:[dict objectForKey:@"firstName"]] 上崩溃;这条线,我该如何解决?