Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
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