• 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
Re: -[NSString localizedCompare:] - example of semantic difference with compare?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -[NSString localizedCompare:] - example of semantic difference with compare?


  • Subject: Re: -[NSString localizedCompare:] - example of semantic difference with compare?
  • From: Aki Inoue <email@hidden>
  • Date: Mon, 27 Mar 2006 14:29:55 -0800

NSCaseInsensitiveSearch
NSLiteralSearch
NSNumericSearch

I'm thus going to assume the following combination of options passed to compare:options:range:locale:

    NSCaseInsensitiveSearch | NSNumericSearch

is functionally equivalent to these options passed to CFStringCompareWithOptions:

kCFCompareInsensitive | kCFCompareLocalized | kCFCompareNumerically | kCFCompareNonliteral


i.e. by not specifying NSLiteralSearch, it will attempt to compare the attached and detached combining marks correctly.
Yes, that's correct.

NSString methods do non-literal comparison/search by default whereas CFString counterparts don't.
That's why the flags are negated.


Aki
_______________________________________________
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


References: 
 >Re: -[NSString localizedCompare:] - example of semantic difference with compare? (From: Ricky Sharp <email@hidden>)
 >Re: -[NSString localizedCompare:] - example of semantic difference with compare? (From: Aki Inoue <email@hidden>)
 >Re: -[NSString localizedCompare:] - example of semantic difference with compare? (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: 1.0 divided by 10 = 0.10000000000000001?
  • Next by Date: Re: 1.0 divided by 10 = 0.10000000000000001?
  • Previous by thread: Re: -[NSString localizedCompare:] - example of semantic difference with compare?
  • Next by thread: Re: -[NSString localizedCompare:] - example of semantic difference with compare?
  • Index(es):
    • Date
    • Thread