• 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: Check for Mac OS Version
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Check for Mac OS Version


  • Subject: Re: Check for Mac OS Version
  • From: Stéphane Sudre <email@hidden>
  • Date: Wed, 30 Mar 2005 22:40:12 +0200


mercredi 30 mars 2005, à 09:36 PM, Adam a écrit :

How can I check to see what version of Mac OS the user is running? Specifically I want to know if they are using anything less then 10.3.

if ([PBSystemUtilities systemMajorVersion]>= PBPanther) { NSLog(@"Argh, the Finder is using Brushed Metal!"); }


#import <Foundation/Foundation.h>

typedef enum _PBOSVersion
{
    PBOSVersionError=-1,
    PBJaguar=0x1020,
    PBPanther=0x1030,
    PBTiger=0x1040,
} PBOSVersion;

@interface PBSystemUtilities : NSObject
{

}

+ (PBOSVersion) systemMajorVersion;

@end

--------8<--------------8<-----------------

#import "PBSystemUtilities.h"
#include <Carbon/Carbon.h>

@implementation PBSystemUtilities

+ (PBOSVersion) systemMajorVersion
{
    OSErr tError;
    unsigned long tSystemVersion;

    tError=Gestalt(gestaltSystemVersion,&tSystemVersion);

    if (tError==noErr)
    {
        return (PBOSVersion) (tSystemVersion & 0x0000FFF0);
    }

    return PBOSVersionError;
}

@end

-------------8<----------8<-----------


_______________________________________________ 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: 
 >Check for Mac OS Version (From: Adam <email@hidden>)

  • Prev by Date: Re: Mouse Input...
  • Next by Date: Re: boundingRectForGlyphRange oddness - what on earth?
  • Previous by thread: Re: Check for Mac OS Version
  • Next by thread: Re: Check for Mac OS Version
  • Index(es):
    • Date
    • Thread