Re: Sorting Array Alphabetically
Re: Sorting Array Alphabetically
- Subject: Re: Sorting Array Alphabetically
- From: Shamyl Zakariya <email@hidden>
- Date: Fri, 13 Apr 2007 17:41:34 -0400
That's good to know, thanks!
email@hidden
"Such a theory has to be bizarre and elaborate, as well as being
stupid"
-- Jim Loy, regarding a hollow earth
On Apr 13, 2007, at 4:17 PM, Deborah Goldsmith wrote:
I think the first one will work the way you want by passing
NSString's compare:
Not quite. Based on the sample data, I'm guessing this sort is
intended to be shown to an end user. compare: should *never* be
used to sort a list for display to an end user. It does a
comparison based on the Unicode code point values, which is not
what most users would consider "sorted."
Lists being sorted for end users should *always* use
localizedCompare: or localizedCaseInsensitiveCompare:. Only use
compare: if the end user will not see the ordering.
Deborah Goldsmith
Internationalization, Unicode liaison
Apple Inc.
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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