On Mon, Dec 21, 2009 at 10:18 AM, Ken Tabb <[email protected]> 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 protected] _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
