• 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: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Using NSSortDescriptor to reverse sort an NSArray containing NSString objects (From: George Stuart <email@hidden>)
 >Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects (From: Ken Thomases <email@hidden>)
 >Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects (From: Andrew Merenbach <email@hidden>)
 >Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects (From: George Stuart <email@hidden>)
 >Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects (From: "Adam R. Maxwell" <email@hidden>)
 >Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects (From: Ken Thomases <email@hidden>)
 >Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects (From: "Adam R. Maxwell" <email@hidden>)

  • Prev by Date: Re: Bring app to front
  • Next by Date: Re: Bring app to front
  • Previous by thread: Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects
  • Next by thread: Installing Spin Control alone
  • Index(es):
    • Date
    • Thread