FROM : Chris
DATE : Thu Jun 26 04:27:40 2008
Consider the following code, any NSPredicateEditor gurus:
NSPredicateEditorRowTemplate *tmpTemplate =
[[NSPredicateEditorRowTemplate alloc]
initWithCompoundTypes: [NSArray
arrayWithObjects: [NSNumber numberWithInt: NSNotPredicateType],
nil]];
NSPredicate * tmpPredicate = [NSPredicate predicateWithFormat:@"mykey =
'foo'"];
NSPredicate * tmpCompPredicate = [NSCompoundPredicate
notPredicateWithSubpredicate:tmpPredicate];
double result = [tmpTemplate matchForPredicate:tmpCompPredicate];
NSLog(@"RESULT: %f", result);
This code prints 0.0.
The net effect is that NSPredicateEditor can't display a predicate like
NOT (foo = "bar")
A bug in NSPredicateEditor system perhaps? But surely someone would have
seen it before.
DATE : Thu Jun 26 04:27:40 2008
Consider the following code, any NSPredicateEditor gurus:
NSPredicateEditorRowTemplate *tmpTemplate =
[[NSPredicateEditorRowTemplate alloc]
initWithCompoundTypes: [NSArray
arrayWithObjects: [NSNumber numberWithInt: NSNotPredicateType],
nil]];
NSPredicate * tmpPredicate = [NSPredicate predicateWithFormat:@"mykey =
'foo'"];
NSPredicate * tmpCompPredicate = [NSCompoundPredicate
notPredicateWithSubpredicate:tmpPredicate];
double result = [tmpTemplate matchForPredicate:tmpCompPredicate];
NSLog(@"RESULT: %f", result);
This code prints 0.0.
The net effect is that NSPredicateEditor can't display a predicate like
NOT (foo = "bar")
A bug in NSPredicateEditor system perhaps? But surely someone would have
seen it before.
| Related mails | Author | Date |
|---|---|---|
| Chris | Jun 25, 08:08 | |
| Jim Turner | Jun 25, 15:57 | |
| Chris | Jun 25, 16:19 | |
| Peter Ammon | Jun 25, 22:12 | |
| Chris | Jun 26, 04:27 | |
| Kyle Sluder | Jun 26, 14:53 | |
| Peter Ammon | Jun 27, 02:09 | |
| Chris | Jun 27, 03:48 | |
| Peter Ammon | Jul 4, 01:30 |






Cocoa mail archive

