• 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: Clark Cox <email@hidden>
  • Date: Mon, 21 Dec 2009 12:18:04 -0500

On Mon, Dec 21, 2009 at 10:18 AM, Ken Tabb <email@hidden> wrote:
> Hi folks,
>
> 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?
>
> I could have sworn I heard mention of it in a previous WWDC (probably about
> 10.5), but all attempts at searching result in a load of pages pointing me
> towards Info.plist to get the version number :-/
>
> The other people who I went with think I'm dreaming it...
>
> If one doesn't exist, then I'm guessing doing an NSString subclass would be
> the order of the day (so that I can support / sort alphanumeric version
> "numbers" such as 10C540, or 1.0.1.2b), and then scanning for each period or
> change from number <-> letter, to break the version number down into its
> component parts (eg. so that 10C540 ends up being {10, C, 540}?

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

--
Clark S. Cox III
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

References: 
 >Version number objects (From: Ken Tabb <email@hidden>)

  • Prev by Date: Re: Menu shortcuts without modifiers?
  • Next by Date: Persistent NSOperation?
  • Previous by thread: Version number objects
  • Next by thread: Re: Version number objects
  • Index(es):
    • Date
    • Thread