且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使iPhone应用程序与2.2.1和3.1 SDK兼容?

更新时间:2023-02-09 08:42:02

类似于如何定位特定的iPhone版本?

您可以使用此#define更改为每个SDK构建的内容...

You can use this #define to change what you build for each SDK...

#if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_2_2
// iPhone 3.0 code here
#endif
And do this at run-time to run code for 3.0 and above:

float version = [[[UIDevice currentDevice] systemVersion] floatValue];
if (version >= 3.0){
    // iPhone 3.0 code here
}