• 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 NSArray -- advice on how to accomplish a "simple" alpha ordering?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting NSArray -- advice on how to accomplish a "simple" alpha ordering?


  • Subject: Re: Sorting NSArray -- advice on how to accomplish a "simple" alpha ordering?
  • From: Graham Cox <email@hidden>
  • Date: Wed, 01 Aug 2012 15:07:48 +1000

On 01/08/2012, at 3:01 PM, Erik Stainsby wrote:

> The NSSortDescriptor documentation seems especially opaque to me tonight.
> Surely there is a useful short description somewhere … ?  *whimper*


Sort descriptors are quite easy to use - what's the specific problem?


warning: typed into Mail:

NSSortDescriptor* desc = [NSSortDescriptor sortDescriptorWithKey:@"compare:" ascending:YES];

[myArray sortUsingDescriptors:[NSArray arrayWithObject:desc]];	//<-- myArray assumed to be an NSMutableArray



note that for this simple case, using a sort descriptor might not the most efficient solution.




--Graham



_______________________________________________

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: Sorting NSArray -- advice on how to accomplish a "simple" alpha ordering?
      • From: Graham Cox <email@hidden>
References: 
 >Sorting NSArray -- advice on how to accomplish a "simple" alpha ordering? (From: Erik Stainsby <email@hidden>)

  • Prev by Date: Sorting NSArray -- advice on how to accomplish a "simple" alpha ordering?
  • Next by Date: Re: Sorting NSArray -- advice on how to accomplish a "simple" alpha ordering?
  • Previous by thread: Sorting NSArray -- advice on how to accomplish a "simple" alpha ordering?
  • Next by thread: Re: Sorting NSArray -- advice on how to accomplish a "simple" alpha ordering?
  • Index(es):
    • Date
    • Thread