If I want to target all iOS devices version 4.3 or later, I can use:
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_4_3
Also, if I want to target iOS devices in general, I can use:
#if TARGET_OS_IPHONE
Is there something similar for Mac OS X?
NSAppKitVersionNumberis your friend on OS X. To target eg. 10.5 and upwards, you can do this:Edit: Just seen that there are also
__MAC_OS_X_VERSION_MAX_ALLOWEDand__MAC_OS_X_VERSION_MIN_REQUIREDon OS X, which might work better and which are available in theAvailability.hwhich is not Cocoa dependent.