Reputation: 16813
The following predicate works if I only pass a single itemId
but I wonder what if I have multiple itemId
s, how could I able to make it work ?
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(%K == %@)", kItemId, itemId];
NSArray *filteredArray = [restaurantData.itemArray filteredArrayUsingPredicate:predicate];
Upvotes: 0
Views: 414
Reputation: 8106
You can do IN
query:
NSPredicate *predicate = [NSPredicate predicateWithFormat:
@"(%K IN %@)", kItemId, yourArrayOfItemId];
Upvotes: 1