• 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: August Mueller <email@hidden>
  • Date: Fri, 25 Oct 2013 22:15:30 -0500

On Oct 25, 2013, at 10:53 AM, Sean McBride <email@hidden> 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 (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: 
 >operatingSystemVersionString replacement (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: operatingSystemVersionString replacement (From: "Gary L. Wade" <email@hidden>)
 >Re: operatingSystemVersionString replacement (From: Sean McBride <email@hidden>)

  • Prev by Date: Re: Allowing users to customize keyboard shortcuts
  • Next by Date: UIDocumentInteractionController preview the file will show the status bar
  • Previous by thread: Re: operatingSystemVersionString replacement
  • Next by thread: NSPopupButton and content values binding transformer
  • Index(es):
    • Date
    • Thread