I have set up an NSPredicate to check if the object category_id
is IN
in an NSArray of numbers.
The code:
///This is working
NSArray *arr2 = [[NSArray alloc]initWithObjects:@[@3,@2,@3],nil];
[NSPredicate predicateWithFormat:@"category_id IN %@", arr2]
//This is not working
NSArray *arr = [[NSArray alloc]initWithArray:category_array]; //Array with NSNumbers
[NSPredicate predicateWithFormat:@"category_id IN %@", arr]
This was working fine but after I changed my category_array
to contains NSNumber the predicate stopped working. How I use NSPredicate for NSNumber?
Update: Arrays:
Entity for Category
: