Re: Sorting an NSMutableArray
Re: Sorting an NSMutableArray
- Subject: Re: Sorting an NSMutableArray
- From: Rob Rix <email@hidden>
- Date: Sat, 20 Dec 2008 16:24:25 -0500
See -sortUsingFunction:context: in NSMutableArray’s documentation. As
Ricky Sharp has already mentioned, there’s also -sortUsingSelector:,
however if you’re comparing partly with external data you might like
having the void * context provided by this method.
Sincerely,
Rob
On 20-Dec-08, at 7:15 AM, Jacob Rhoden wrote:
How do you sort an NSMutableArray, when the difference between the
two objects is determined by information not contained completely
within the objects themselves. ie in Java you can implement a
Comparator that takes two objects to compare then. Is this similar
in Cocoa?
ie in this case I need to apply a mathematical algorithm using
information from each object to determine which one is greater than
the other.
Thanks!
Jacob
____________________________
http://jacobrhoden.com
_______________________________________________
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
_______________________________________________
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