NSPredicate: do they ignore [d] or do they?!?
NSPredicate: do they ignore [d] or do they?!?
- Subject: NSPredicate: do they ignore [d] or do they?!?
- From: Ondra Cada <email@hidden>
- Date: Wed, 15 Mar 2006 22:24:35 +0100
Hi,
again here with a strange problem: seems to me predicates plain
ignore the diacritics-insensitiveness switch, [d]:
#import <Cocoa/Cocoa.h>
static inline void pp(NSPredicate *p,NSString *s) {
NSLog(@"string (%@) predicate (%@) -> %d",s,p,[p
evaluateWithObject:s]);
}
int main() {
[NSAutoreleasePool new];
id p=[NSPredicate predicateWithFormat:@"SELF contains[cd] 's'"];
pp(p,@"x");
pp(p,@"s");
pp(p,@"S");
pp(p,[NSString stringWithFormat:@"%C",0x1e67]); // s caron
pp(p,[NSString stringWithFormat:@"%C",0x1e66]); // S caron
return 0;
}
prints out
161 /tmp> cc -Wall q.m -framework Cocoa && ./a.out
2006-03-15 22:20:25.893 a.out[1301] string (x) predicate ("s" IN[cd]
SELF) -> 0
2006-03-15 22:20:25.897 a.out[1301] string (s) predicate ("s" IN[cd]
SELF) -> 1
2006-03-15 22:20:25.900 a.out[1301] string (S) predicate ("s" IN[cd]
SELF) -> 1
2006-03-15 22:20:25.911 a.out[1301] string (ṧ) predicate ("s" IN[cd]
SELF) -> 0
2006-03-15 22:20:25.911 a.out[1301] string (Ṧ) predicate ("s" IN[cd]
SELF) -> 0
162 /tmp>
Am I overlooking something obvious, or is that a bug? I've tried to
google it out, but all hits taught me the different NSPredicate and
Spotlight syntax, which I can do easily without at the moment :)
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden