I have a fairly complex NSPredicate which works correctly, but I am
trying to compound it with with a subpredicate that contains a logical
NOT. I have tried using many combinations of the predicate syntax, but
I can't seem to get it working. What I am trying to do it exclude
files from being picked up based on an NSArray of names
these don't work
NSPredicate *doesNotContainTheseFilesPredicate = [NSPredicate
predicateWithFormat:@"NONE (kMDItemFSName in %@)", myFileNameArray];
NSPredicate *doesNotContainTheseFilesPredicate = [NSPredicate
predicateWithFormat:@"NONE kMDItemFSName in %@", myFileNameArray];
I also tried creating separate NSPredicates and then ANDing them
together like
NSPredicate *doesNotContainThisFile1Predicate = [NSPredicate
predicateWithFormat:@"NOT (kMDItemFSName LIKE %@)", @"filename.txt"];
NSPredicate *doesNotContainThisFile2Predicate = [NSPredicate
predicateWithFormat:@"NOT (kMDItemFSName LIKE %@)", @"filename2.txt"];