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?
Helpful answers. You can only update to a specific OS version if you previously downloaded it, and associated it with your Apple ID at any time. Then this version would be available for download from the Purchased Tab in the Mac App Store.
NSAppKitVersionNumber
is your friend on OS X. To target eg. 10.5 and upwards, you can do this:
#if NSAppKitVersionNumber >= NSAppKitVersionNumber10_5
// ...
#endif
Edit: Just seen that there are also __MAC_OS_X_VERSION_MAX_ALLOWED
and __MAC_OS_X_VERSION_MIN_REQUIRED
on OS X, which might work better and which are available in the Availability.h
which is not Cocoa dependent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With