I have NSMutableArray with NSString objects.
How can I filter it to get only the objects, which DOES NOT contain a string?
I tried NSPredicate to filter objects which contain a string:
NSString *match = @"My text";
NSPredicate *sPredicate = [NSPredicate predicateWithFormat:@"SELF CONTAINS[cd] %@", match];
[self.filesList setArray:[self.filesList filteredArrayUsingPredicate:sPredicate]];
Is there anything similar, but to filter it vice-versa? Some kind of ” !contains ” ?
Use this instead:
NSPredicate *sPredicate = [NSPredicate predicateWithFormat:@"NOT (SELF CONTAINS[cd] %@)", match];