Re: Getting Current System Version
Re: Getting Current System Version
- Subject: Re: Getting Current System Version
- From: Shaun Wexler <email@hidden>
- Date: Sun, 10 Apr 2005 23:42:16 -0700
On Apr 9, 2005, at 9:16 PM, Dan Saul wrote:
Hello there, I am having trouble getting my code to detect the current
operating system using Gestalt, I am running 10.3.
typedef enum {
TRVersionNotChecked = -2,
TRUnknownVersion,
TRCheetahVersion,
TRPumaVersion,
TRJaguarVersion,
TRPantherVersion,
TRTigerVersion
} TROperatingSystemVersion;
+ (TROperatingSystemVersion)operatingSystemVersion
{
static TROperatingSystemVersion version = TRVersionNotChecked;
if (version == TRVersionNotChecked)
{
long response;
if (Gestalt(gestaltSystemVersion, &response) != noErr) {
[NSException raise:@"Gestalt Exception"
format:@"gestaltSystemVersion failed"];
}
if (response >= 0x1050 || response < 0x1000) {
version = TRUnknownVersion;
}
else if (response >= 0x1040) {
version = TRTigerVersion;
}
else if (response >= 0x1030) {
version = TRPantherVersion;
}
else if (response >= 0x1020) {
version = TRJaguarVersion;
}
else if (response >= 0x1010) {
version = TRPumaVersion;
}
else if (response >= 0x1000) {
version = TRCheetahVersion;
}
}
return version;
}
--
Shaun Wexler
MacFOH
http://www.macfoh.com
"If God dropped acid, would he see people?" - Steven Wright
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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