Re: Version number objects
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