Re: Checking OS Version with Cocoa
Re: Checking OS Version with Cocoa
- Subject: Re: Checking OS Version with Cocoa
- From: Jim Correia <email@hidden>
- Date: Sat, 4 Jan 2003 17:12:16 -0500
On Saturday, January 4, 2003, at 04:56 PM, Chad Armstrong wrote:
Is there a way to check a machine's OS version using Cocoa? I've
searched through some books, the web, and even these archives and
didn't find anything right off hand. I've seen some Carbon code in
doing this, but not Cocoa.
Is there a reason why you can't just use the "Carbon" code?
SInt32 GetSystemVersion()
{
static SInt32 gSystemVersion;
if (gSystemVersion == 0)
{
if (noErr != Gestalt(gestaltSystemVersion, &gSystemVersion))
gSystemVersion = 0;
}
return gSystemVersion;
}
It will return 0x1023 for 10.2.3.
Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.