I have an NSMutableArray (self.allPeople) containing a number of dictionaries (people). That said, I also have an NSMutableArray (self.participants) that contains a series of numbers:
self.participants
Here they are: (
179,
125,
231
)
I want filter self.allPeople, and only return dictionaries in which the key "nid" is equal to one of the numbers contained in self.participants.
How can I filter self.allPeople (valueForKey:@"nid") with each number in self.participants?
This works if I only want to filter by a single string value, but I need it to filter for all numbers:
NSPredicate *p = [NSPredicate predicateWithFormat:@"nid CONTAINS[cd] %@", @"179"];
self.results = [self.allPeople filteredArrayUsingPredicate:p];