I know you can do something like [..."SELF.some_id == [c] %d AND SELF.some_id == [c] %d", id1, id2], but I need more than this. Is there a way to do this without building a string.
NSArray *arrayOfWantedWidgetIds = @[1,3,5,6,9,13,14,16]; NSMutableArray *allWidgets = [[WidgetManager sharedWidget] getAllWidgets]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF.widget_id ==[c] %d", arrayOfWantedWidgetIds]; //obviously we can't do this, it won't accept an array of IDS for %d [allWidgets filterArrayUsingPredicate:predicate];
How can I achieve something like this? Another way... if I looped this, and made individual predicates for each value in arrayOfWantedWidgetIds, and then add all the individual predicates into an array... this doesn't help either as filterArrayUsingPredicate only accepts an NSPredicate. Not an array of them.