I have an NSArray that I want to filter out specific objects with NSPredicate, I was hoping I could use NOT IN since I saw that I can easily do IN.
So I have an array:
self.categoriesList
Then I get the values ââI want to delete:
NSArray *parentIDs = [self.cateoriesList valueForKeyPath:@"@distinctUnionOfObjects.ParentCategoryID"];
This gives me a list of ParentCategoryID for categories that I DO NOT want to display, so I suppose I can use NSPredicate to remove them:
self.cateoriesList = [self.cateoriesList filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"CategoryID NOT IN %@",parentIDs]];
This fails:
reason: 'Unable to parse the format string "CategoryID NOT IN %@"'
If I wanted to use only IN, which works fine, of course.
ios objective-c nsarray
Slee Dec 20 '11 at 19:14 2011-12-20 19:14
source share