• 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: Sorting Array Alphabetically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Sorting Array Alphabetically (From: Micha Fuhrmann <email@hidden>)
 >Re: Sorting Array Alphabetically (From: Shamyl Zakariya <email@hidden>)
 >Re: Sorting Array Alphabetically (From: Deborah Goldsmith <email@hidden>)

  • Prev by Date: Re: ScriptEditor thinks my command is a variable
  • Next by Date: making an NSView with scrollbars "inactive"
  • Previous by thread: Re: Sorting Array Alphabetically
  • Next by thread: Re: Sorting Array Alphabetically
  • Index(es):
    • Date
    • Thread