I give up. I tried every combination that I can imagine to check if a string contains another string. Here is an intuitive syntax example that describes what I want to do:
NSPredicate* pPredicate = [NSPredicate predicateWithFormat:@"NOT (%K CONTAINS[c] %@)",
NSMetadataItemFSNameKey,
[NSString stringWithFormat:@"Some String"]];
No matter how I move NOT around, use! instead, copy the brackets or delete them altogether, I always get an exception by parsing this expression.
What is wrong with this expression?
EDIT: An exception occurs when I call
[pMetadataQuery setPredicate:pPredicate]
and exception: * The application terminated due to the unmasked exception "NSInvalidArgumentException", reason: "Unknown type NSComparisonPredicate provided by NSMetadataQuery (kMDItemFSName CONTAINS [c]" Some String ") '
source