Re: Exclude or Negate NSComparisonPredicate

2012-05-21 Thread Tim Schröder
I use this code to search for something *not* containing someString with NSMetadataquery: predicate = [NSPredicate predicateWithFormat:@"NOT kMDItemFSName LIKE '%@'", someString]; As NSMetadataQuery only uses a subset of the NSPredicate syntax, I doubt whether using NSCompoundPredicate or some

Re: Exclude or Negate NSComparisonPredicate

2012-05-21 Thread Dave DeLong
You'd keep most of what you have, but just add in the negation: On May 21, 2012, at 11:47 AM, Chris Paveglio wrote: > I'm doing an NSMetadataQuery something like this: > > NSPOT = NSLikePredicateOperatorType; > myPredicate = [NSComparisonPredicate > predicateWithLeftExpression:[NSExpressionexpre

Exclude or Negate NSComparisonPredicate

2012-05-21 Thread Chris Paveglio
I'm doing an NSMetadataQuery something like this: NSPOT = NSLikePredicateOperatorType; myPredicate = [NSComparisonPredicate predicateWithLeftExpression:[NSExpressionexpressionForKeyPath:@"*"]  rightExpression:[NSExpressionexpressionForConstantValue:@"somestring"] modifier:NSDirectPredicateModifier