Checking for El Capitan
If you’re running on OS X 10.10.2 or later, the code tells you that you’re running on OS X 10.11. What happened? Let’s look at <AppKit/NSApplication.h> from the 10.11 SDK:
#define NSAppKitVersionNumber10_10 1343So far, so good.
#define NSAppKitVersionNumber10_10_2 1344 #define NSAppKitVersionNumber10_10_3 1347WHUT.
So yeah, instead of increasing the fractional part of the constant for 10.10.2 and 10.10.3, they increased the integer part. Sigh.
Update (2015-08-22): My solution is to check whether I’m running Mac OS X 10.10.0 or later, and then use -[NSProcessInfo isOperatingSystemAtLeastVersion:]
.