On Oct 25, 2013, at 10:53 AM, Sean McBride <s...@rogue-research.com> wrote:

> I agree with others that NSAppKitVersionNumber and friends are usually 
> preferable, but sometimes it is useful/required to get the actual numbers 
> "10", "8", and "5" in a parseable/non-localized way.  Parsing uname results 
> is fragile.  operatingSystemVersionString is localized.  Assuming 
> /System/Library/CoreServices/SystemVersion.plist will always be at that path 
> is fragile.  Can you even read it when sandboxed?
> 
> Gestalt(), despite being deprecated, is the safest way:
> 
>       Gestalt (gestaltSystemVersionMajor, &major);
> Gestalt (gestaltSystemVersionMinor, &minor);
>       Gestalt (gestaltSystemVersionBugFix, &fix);
> 
> IMHO, it was deprecated prematurely, without a replacement for uses like this.

Here's a little Gestalt replacement I wrote for myself a while back:
https://gist.github.com/ccgus/6384865

It uses SystemVersion.plist, but I'm pretty that's not going to be moved around 
anytime soon.

-gus
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to