Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SInt32 systemVersion
- Gestalt(gestaltSystemVersion, (SInt32*)&systemVersion);
- if (systemVersion >= 0x1070){ //OSX 10.7
- }else{//OSX 10.6
- }
- enum {
- MDUndeterminedVersion = −1,
- MDTiger = 0x1040,
- MDLeopard = 0x1050,
- MDSnowLeopard = 0x1060,
- MDLion = 0x1070,
- MDUnknownKitty = 0x1080,
- MDUnknownVersion = 0x1090
- };
- static SInt32 MDSystemVersion = MDUndeterminedVersion;
- @implementation
- + (void)initialize {
- if (MDSystemVersion == MDUndeterminedVersion) {
- SInt32 MDFullSystemVersion = 0;
- Gestalt(gestaltSystemVersion, &MDFullSystemVersion);
- MDSystemVersion = MDFullSystemVersion & 0xfffffff0;
- }
- }
- - (void)someMethod {
- if (MDSystemVersion >= MDLion) {
- } else {
- }
- }
- @end
Add Comment
Please, Sign In to add comment