Search code examples
iphoneiossdkpreprocessorbackwards-compatibility

iPhone - Compiling on older SDK : __IPHONE_OS_VERSION_MAX_ALLOWED values


I need test some stuff with preprocessor tests to ensure backward compatibility for my app.
To do this, I must use __IPHONE_OS_VERSION_MAX_ALLOWED >= xxx but does someone know where I can find the values to test for each existing SDK ?


Solution

  • If you command-click on __IPHONE_OS_VERSION_MAX_ALLOWED (in Xcode) you'll see the current definition (in AvailabilityInternal.h) for the current SDK and the older SDK.

    They are basically __IPHONE_4_3, __IPHONE_4_2, __IPHONE_4_1, __IPHONE_4_0, __IPHONE_3_0, etc.