I am trying to add in tempArray only even number of data.localBookmarks is array of dictionary. Here is my code :
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;
my app crash on [tempArray addObject:[dict objectForKey:@"firstName"]]; this line ,How can I fix it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…