I have one main array named originalListArray with multiple objects.Here is the example of object. Example.json
I want to find that number of objects from the originalListArray, who have amenity_id matched with my filter data. I have do this, create one predicate usign ANY not self becuase NSArray with NSDictionary and in that Dictionary object may have NSArray data.
This is working fine.
NSPredicate *predicate=[NSPredicate predicateWithFormat:@"ANY amenities.amenity_id =='1')"];
This is not working.
NSPredicate *predicate=[NSPredicate predicateWithFormat:@"ANY amenities.amenity_id in ('1','2','3')"];
So Single value can be filter easily but usign IN oparation its crash and error is like this.
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse the format string "ANY amenities.amenity_id in ('1','2','3')"'
Thanks in advanced, if any one can help me in this.
[NSPredicate predicateWithFormat:@"ANY amenities.amenity_id IN %@", @[@"1",@"2",@"3"]]? - Larme@"ANY amenities.amenity_id IN {'1', '2', '3'}"(using bracelets instead of parenthesis). Not, passing it with a placeholder (%@) gives more easily changes if needed. - Larme