• 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: Robert Walker <email@hidden>
  • Date: Fri, 13 Apr 2007 17:27:32 -0400

http://developer.apple.com/documentation/Cocoa/Conceptual/Collections/ Articles/Arrays.html#//apple_ref/doc/uid/20000132-DontLinkElementID_5

That should answer all your questions...

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

On Apr 13, 2007, at 6:57 AM, Shamyl Zakariya wrote:

____________________________________________

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:
40mac.com


This email sent to email@hidden

-- Robert Walker 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: Sorting Array Alphabetically
  • Next by Date: Re: ScriptEditor thinks my command is a variable
  • Previous by thread: Re: Sorting Array Alphabetically
  • Next by thread: Re: Sorting Array Alphabetically
  • Index(es):
    • Date
    • Thread