• 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: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare


  • Subject: Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
  • From: Markus Spoettl <email@hidden>
  • Date: Sat, 05 May 2012 23:46:10 +0200

On 05.05.12 23:07, Martin Wierschin wrote:
So, when using a binary search, I get different answers depending on the other strings in the list!

Seems to work for me:

On 10.7.3, Xcode 4.3.1, for both locale en_US and locale de_AT I get:

(lldb) p (NSComparisonResult)[@"laßt" localizedCaseInsensitiveCompare:@"aaa"]
(NSComparisonResult) $4 = 1
(lldb) p (NSComparisonResult)[@"laßt" localizedCaseInsensitiveCompare:@"laso"]
(NSComparisonResult) $5 = 1
(lldb) p (NSComparisonResult)[@"laßt" localizedCaseInsensitiveCompare:@"lasso"]
(NSComparisonResult) $6 = 1
(lldb) p (NSComparisonResult)[@"laßt" localizedCaseInsensitiveCompare:@"zzz"]
(NSComparisonResult) $7 = -1
(lldb)

Are you sure your debugger isn't lying to you? Maybe you have category on NSString that does that?

Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
      • From: Martin Wierschin <email@hidden>
    • Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
      • From: "Stephen J. Butler" <email@hidden>
    • Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
      • From: Ken Thomases <email@hidden>
References: 
 >inconsistent behavior of NSString's localizedCaseInsensitiveCompare (From: Martin Wierschin <email@hidden>)

  • Prev by Date: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
  • Next by Date: Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
  • Previous by thread: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
  • Next by thread: Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
  • Index(es):
    • Date
    • Thread