Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check whether running on Lion or Snow Leopard

In my Cocoa application I would like to let the user take the app full screen on Lion. To do this I would like to add the following:

if (check for lion or above) {
    [mywindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
}

I am adding this conditionally for Lion because NSWindowCollectionBehaviorFullScreenPrimary is only available from 10.7. What is the best way towards the check for lion or above?

like image 238
AmaltasCoder Avatar asked Aug 16 '11 14:08

AmaltasCoder


People also ask

How do I know if I have Snow Leopard?

Snow leopards have thick grey and yellow-tinged fur, with solid spots on their head, neck and lower limbs and rosettes over the rest of the body. Rosettes are large rings enclosing smaller spots. WWF relies on spot patterns to identify individual snow leopards when conducting camera trap research.

Is a Snow Leopard faster than a Lion?

Overall, and in general, Snow Leopard beat out Lion by a small margin. You can watch the tests side by side in the video above and view the results in the table below. There's more to these tests than just the numbers, however, as we believe they may point to hardly any difference in speed at all.

How do I upgrade from Snow Leopard to Lion?

If you're running Snow Leopard, just go to Menu > About This Mac and make sure you're running Snow Leopard 10.6. 8, which adds support to upgrade to Lion through the Mac App Store. If you're not, just go to Menu > Software Update, download and install the update.

What version of IOS is Leopard?

Mac OS X Leopard (version 10.5) is the sixth major release of macOS, Apple's desktop and server operating system for Macintosh computers.


1 Answers

You should read documentation about the Gestalt function.

SInt32 MacVersion;

if( Gestalt( gestaltSystemVersion, &MacVersion ) == noErr )
{
    if( MacVersion == 0x1050 ) /* Mac OS X 10.5.0 */
    {}
    else
    {}
}

Or you can use the SysCTL API

like image 165
Macmade Avatar answered Oct 27 '22 09:10

Macmade