• 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: operatingSystemVersionString replacement
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: operatingSystemVersionString replacement


  • Subject: Re: operatingSystemVersionString replacement
  • From: "Gary L. Wade" <email@hidden>
  • Date: Fri, 25 Oct 2013 10:49:40 -0700
  • Thread-topic: operatingSystemVersionString replacement

For any Apple people who care, there's now rdar://15320964 to help with
this conundrum.  For anyone else, feel free to file your bugs.
--
Gary L. Wade
http://www.garywade.com/


On 10/25/2013 8:53 AM, "Sean McBride" <email@hidden> wrote:

>On Fri, 25 Oct 2013 06:02:23 -0700, Gary L. Wade said:
>
>>Not to say using the OS version number is right in your case, but when I
>>need a parseable OS version number without relying upon Gestalt, I get
>>the
>>ProductVersion key from /System/Library/CoreServices/SystemVersion.plist
>>and parse that into an NSIndexPath, which works great with encapsulating
>>10.8.5, 10.9, 10.7.5.12, etc.
>
>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.
>
>Cheers,
>
>--
>____________________________________________________________
>Sean McBride, B. Eng                 email@hidden
>Rogue Research                        www.rogue-research.com
>Mac Software Developer              Montréal, Québec, Canada
>
>



_______________________________________________

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: 
 >Re: operatingSystemVersionString replacement (From: Sean McBride <email@hidden>)

  • Prev by Date: Autolayout wrt Cassowary
  • Next by Date: Re: Autolayout wrt Cassowary
  • Previous by thread: Re: operatingSystemVersionString replacement
  • Next by thread: Re: operatingSystemVersionString replacement
  • Index(es):
    • Date
    • Thread