NSAppKitVersionNumber
is your friend in OS X. To target, for example. 10.5 and above, you can do this:
#if NSAppKitVersionNumber >= NSAppKitVersionNumber10_5
Edit: We just saw that on OS X there are also __MAC_OS_X_VERSION_MAX_ALLOWED
and __MAC_OS_X_VERSION_MIN_REQUIRED
, which can work better and are available in Availability.h
, which is Cocoa independent.
source share