I am trying to store only the Twitter id's from the following json data:
( { id = chuckschumer; type = Facebook; }, { id = SenSchumer; type = Twitter; }, { id = SenatorSchumer; type = YouTube; } ),
I am working in objective-C. How would I pull only the id's that have a type = Twitter? Any advice is appreciated.
I then attempted to use NSPredicate but my filtered array continues to return as nil. Here is my code:
NSPredicate *filter = [NSPredicate predicateWithFormat:@"(type = 'Twitter')"]; NSArray *filteredItems = [channels filteredArrayUsingPredicate:filter]; NSLog(@"%@", filteredItems);
filteredItems continues to return nil, not sure why