How to check for 10.11 El Capitan at runtime

https://developer.apple.com/library/prerelease/mac/releasenotes/AppKit/RN-AppKit/index.html suggests using something like this code to check for El Capitan at runtime:


    if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_9) {
        NSLog(@"Something old");
    } else if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_10) {
        NSLog(@"Yosemite");
    } else {
        NSLog(@"El Capitan");
    }


The problem is that this code when run on Yosemite outputs "El Capitan".


As far as I can tell, the NSAppKitVersionNumber on 10.10.3 is 1347, while NSAppKitVersionNumber10_10 is defined at 1343.

Use the NSProcessInfo class. Is the official way.

Can you give a source for it being the official way? The OS X 10.11 release notes do not mention it, they only mention the NSAppKitVersionNumber way.

How to check for 10.11 El Capitan at runtime
 
 
Q