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
Update:
Use #define NSAppKitVersionNumber10_10_Max 1349
Old:
From 10.11 SDK
#define NSAppKitVersionNumber10_7_2 1138.23
#define NSAppKitVersionNumber10_7_3 1138.32
#define NSAppKitVersionNumber10_7_4 1138.47
#define NSAppKitVersionNumber10_8 1187
#define NSAppKitVersionNumber10_9 1265
#define NSAppKitVersionNumber10_10 1343
#define NSAppKitVersionNumber10_10_2 1344
#define NSAppKitVersionNumber10_10_3 1347
for 10.10.4 Its 1348.0
(From NSLog output)
They increase decimal part for 10.10.x constant.
The workaround is to use CFBundleVersion
value /System/Library/Frameworks/AppKit.framework/Resources/Info.plist
on 10.11.
if (NSAppKitVersionNumber < 1391.12)
{
/* On a 10.10.x or earlier system */
}
NOTE: My OS X 10.11 build version is 15A244a. If someone have first build , Please update the value in if condition.