• 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: NSMutableArray sorting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableArray sorting


  • Subject: Re: NSMutableArray sorting
  • From: "Adam R. Maxwell" <email@hidden>
  • Date: Sun, 21 Dec 2008 19:30:59 -0800


On Dec 21, 2008, at 8:23 PM, Scott Ribe wrote:

Yes, I think the key is that the expensive calculation is done only once for
each object rather than every time a comparison needs to be made.

Yes, largely. It is possible that the overhead from Objective-C method calls
to a comparison selector could then be significant after that optimization
is made--but much less likely.

Have you tried using NSSortDescriptor for sorting? It caches the result of valueForKeyPath: internally, and is quite fast (as long as you don't subclass it).


--
adam


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: NSMutableArray sorting
      • From: Scott Ribe <email@hidden>
References: 
 >Re: NSMutableArray sorting (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: NSMutableArray sorting
  • Next by Date: Re: NSMutableArray sorting
  • Previous by thread: Re: NSMutableArray sorting
  • Next by thread: Re: NSMutableArray sorting
  • Index(es):
    • Date
    • Thread