• 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: Right way to check system version?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Right way to check system version?


  • Subject: Re: Right way to check system version?
  • From: Steve Checkoway <email@hidden>
  • Date: Fri, 19 May 2006 05:00:28 -0700


On May 19, 2006, at 12:47 AM, Ron Fleckner wrote:

Hi,

I was wondering whether this was a good enough way to see what system my app is running on. I need to see if it's running on Jaguar to decide whether to set up a particular UI widget, because I know it won't work properly on Jaguar.

Here's what I did:
...
I'd like to think there is a simpler, more direct way. I looked at Gestalt in the docs, but found this at the end of the section about System Version Selector:


A better way to obtain version information in Mac OS X is to read the system version information from the following file:

/System/Library/CoreServices/SystemVersion.plist

Never infer the existence of certain hardware or software features from the responses that Gestalt returns when you pass it this selector.
int main()
{
	OSErr err;
	long code;
	/* Get system version */
	err = Gestalt( gestaltSystemVersion, &code );
	if( err == noErr )
	{
		int major = ( (code >> 12) & 0xF ) * 10 + (code >> 8) & 0xF;
		int minor = (code >> 4) & 0xF;
		int revision = code & 0xF;

		printf( "Mac OS X %d.%d.%d\n", major, minor, revision );
	}
	return 0;
}

- Steve

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Right way to check system version?
      • From: "Finlay Dobbie" <email@hidden>
    • Re: Right way to check system version?
      • From: Chris Ridd <email@hidden>
References: 
 >Right way to check system version? (From: Ron Fleckner <email@hidden>)

  • Prev by Date: Re: can't get DOMDocument from WebView
  • Next by Date: NSPopUpButtons in tableViews
  • Previous by thread: Right way to check system version?
  • Next by thread: Re: Right way to check system version?
  • Index(es):
    • Date
    • Thread