Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects
Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects
- Subject: Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects
- From: "Kyle Sluder" <email@hidden>
- Date: Sun, 8 Jun 2008 23:15:18 -0400
On Fri, Jun 6, 2008 at 6:53 PM, Adam R. Maxwell <email@hidden> wrote:
> So for an array of NSNumbers you could use -description and a
> -numericCompare: method that uses NSNumericSearch. In my opinion, it makes
> more sense to use -self and -compare: for NSDate/NSNumber.
To me, option 1 only makes sense when you're comparing display strings
(and even then, -description probably isn't what I would use because
it isn't locale-aware; that's why we have NSFormatters). I would use
-compare: whenever your comparison is semantic.
--Kyle Sluder
_______________________________________________
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