• 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: Getting Current System Version
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Getting Current System Version (From: Dan Saul <email@hidden>)
 >Re: Getting Current System Version (From: Shaun Wexler <email@hidden>)

  • Prev by Date: Re: Getting Current System Version
  • Next by Date: Re:Structuring multi-framework projects
  • Previous by thread: Re: Getting Current System Version
  • Next by thread: Rotating an NSImage
  • Index(es):
    • Date
    • Thread