daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Jul 19th, 2018 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SInt32 systemVersion
  2. Gestalt(gestaltSystemVersion, (SInt32*)&systemVersion);
  3.    
  4. if (systemVersion >= 0x1070){ //OSX 10.7
  5. }else{//OSX 10.6
  6. }
  7.    
  8. enum {
  9.     MDUndeterminedVersion    = −1,
  10.     MDTiger                  = 0x1040,
  11.     MDLeopard                = 0x1050,
  12.     MDSnowLeopard            = 0x1060,
  13.     MDLion                   = 0x1070,
  14.     MDUnknownKitty           = 0x1080,
  15.     MDUnknownVersion         = 0x1090
  16. };
  17.  
  18. static SInt32 MDSystemVersion = MDUndeterminedVersion;
  19.  
  20. @implementation
  21.  
  22. + (void)initialize {
  23.     if (MDSystemVersion == MDUndeterminedVersion) {
  24.         SInt32 MDFullSystemVersion = 0;
  25.         Gestalt(gestaltSystemVersion, &MDFullSystemVersion);
  26.         MDSystemVersion = MDFullSystemVersion & 0xfffffff0;
  27.     }
  28. }
  29.  
  30. - (void)someMethod {
  31.    if (MDSystemVersion >= MDLion) {
  32.  
  33.    } else {
  34.  
  35.    }
  36. }
  37.  
  38. @end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top