How can I determine the running Mac OS X version programmatically?

See this article here

But in short, if you’re using carbon, use the Gestalt() call, and if you’re using cocoa, there is a constant called NSAppKitVersionNumber which you can simply check against.

Edit: For Mac OSX 10.8 and above, don’t use Gestalt() anymore. See this answer for more details: How do I determine the OS version at runtime in OS X or iOS (without using Gestalt)?

Leave a Comment