• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSPredicate: do they ignore [d] or do they?!?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Prev by Date: Re: Transparent window for messages
  • Next by Date: Reporting/Printing engine
  • Previous by thread: General approach to binding of text fields
  • Next by thread: Reporting/Printing engine
  • Index(es):
    • Date
    • Thread