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:35:17 -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 operatingSystemVersion = TRVersionNotChecked;
if (operatingSystemVersion == TRVersionNotChecked)
{
long response;
if (Gestalt(gestaltSystemVersion, &response) != noErr) {
[NSException raise:@"Gestalt Exception"
format:@"gestaltSystemVersion failed"];
}
if (response >= 0x1050 || response < 0x1000) {
operatingSystemVersion = TRUnknownVersion;
}
else if (response >= 0x1040) {
operatingSystemVersion = TRTigerVersion;
}
else if (response >= 0x1030) {
operatingSystemVersion = TRPantherVersion;
}
else if (response >= 0x1020) {
operatingSystemVersion = TRJaguarVersion;
}
else if (response >= 0x1010) {
operatingSystemVersion = TRPumaVersion;
}
else if (response >= 0x1000) {
operatingSystemVersion = TRCheetahVersion;
}
}
return operatingSystemVersion;
}
--
Shaun Wexler
MacFOH
http://www.macfoh.com
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