I use the following NSPredicate to filter,
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(firstName CONTAINS %@ ) OR (lastName CONTAINS %@ )OR (UserName CONTAINS %@ ) ", myText,myText,myText]; NSArray *filtered = [responseArray filteredArrayUsingPredicate:predicate];
It works great, but is case sensitive. I need the filtering to be case insensitive.
I tried,
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(ANY firstName CONTAINS %@ ) OR (ANY lastName CONTAINS %@ )OR (ANY UserName CONTAINS %@ ) ", myText,myText,myText];
But he gives an error
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'The left hand side for an ALL or ANY operator must be either an NSArray or an NSSet.'
I do not understand what was mentioned in this answer . Can anyone suggest that I should change here in the above filtering?
source share