I am trying to see if my nsarray has data before I gray out cell text – but for some reason it’s blowing up on the if evaluation with the dreaded SIGBRT… the following code is works fine if the key ‘myIndex’ exists …I delete the key when the user sends his orders in at the end of the app….so when the app opens after an order I would like to skip ?????
if(![[[inList objectAtIndex:0] objectForKey:@"myIndex"] count] == 0){
NSArray *myIndexList = [[inList objectAtIndex:0] objectForKey:@"myIndex"];
NSLog( @"data from INDEX !!!!!!!! %@", myIndexList);
for(int n=0; n<[myIndexList count]; n++)
{
if(indexPath.row == [[myIndexList objectAtIndex:n] integerValue])
{
cell.textLabel.textColor = [UIColor lightGrayColor];
}
}
}
Many thanks for your time and help.
You need to make sure that there is an object in inList first: