I am returning a JSON array: Array 2: ( {"checkin_ID" = 123}, {"checkin_ID" = 121;}, {"checkin_ID" = 99;}, etc)
In my code each cell has it's own checkin_ID. If the checkin_ID of the cell matches any number or string from my JSON array, I would like to show a button.
Any ideas?
Code:
ViewDidLoad:
NSError *error = nil; NSDictionary *dict2 = [[CJSONDeserializer deserializer] deserializeAsDictionary:jsonData2 error&error2];
if (dict2) {
rows2 = [dict2 objectForKey:@"likes"];
}
Cell Construction:
NSPredicate *checkinIDPredicate = [NSPredicate predicateWithFormat:@"checkin_ID == %d", myInt];
NSArray *matchingCheckins = [rows2 filteredArrayUsingPredicate:checkinIDPredicate];
if([matchingCheckins count] > 0) // Show the button, etc.
In my NSLog
after adding your code... Predicate checkin_ID = 121 Matching Predicate ()