Re: NSMutableArray sorting
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