I am using below code to check OS X version at runtime.
if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_10)
{
/* On a 10.10.x or earlier s
So the #define for 10_10
you see there is for 10.10.0
.
If you look for older version numbers, you'll see specific #define
's for MacOS 10.7.4, MacOS 10.5.3.
And what is happening here is that on a 10.10.4 machine (like yours and mine), the app kit number for 10.10.4 is greater than the one defined for 10.10.0.
That is, in swift, I did:
func applicationDidFinishLaunching(aNotification: NSNotification) {
print("appkit version number is \(NSAppKitVersionNumber)")
}
And I got:
appkit version number is 1348.17
So your code is actually checking for 10.10.0 and older.
If you want to check for all versions of Yosemite & newer, you'll probably want to do something like
#ifdef NSAppKitVersionNumber10_11
if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_11)
{
/* On a 10.10.x or earlier system */
}
#endif
which will compile once you start building with Xcode 7 (and once Apple gets around to defining the official shipping version/build number for the El Capitan release)
FWIW, the Xcode 7 beta I have includes "NSAppKitVersionNumber10_10_3
" in the 10.11 SDK.