• 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: Version number objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Version number objects


  • Subject: Re: Version number objects
  • From: Gregory Weston <email@hidden>
  • Date: Mon, 21 Dec 2009 16:25:33 -0500

Ken Tabb wrote:

> I've got an app that needs to keep track of version numbers (eg.
> "10.6.2") of things, and needs to be able to sort by these too. Is
> there a class in Cocoa that handles this?

To which Clark Cox replied:

> NSString's -compare:options: already handles mixed
> alphanumeric strings like this when passed the NSNumericSearch option.

How well does it handle something like 1.0.1b5, or something to that effect, though? I knocked out a category on NSString several years ago that converts back and forth between a string and Apple's NumVersion structure and provides a comparison method. I'm willing to share, or can post it somewhere if there's a common site for such things.

G
_______________________________________________

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: Version number objects
      • From: Uli Kusterer <email@hidden>
  • Prev by Date: Re: Simple question on Menus and Document-based apps
  • Next by Date: Re: Core Data validateForUpdate
  • Previous by thread: Re: Version number objects
  • Next by thread: Re: Version number objects
  • Index(es):
    • Date
    • Thread