1

如果用户在运行 OS 2.x 或 3.0 的设备上运行它,有什么方法可以在我的应用程序中找到?

我尝试像 iPhone 项目模板那样添加标签,但它似乎不起作用。

#ifndef __IPHONE_3_0
//MY CODE FOR 3.0 GOES HERE
#else
//2.x CODE HERE
#endif

谢谢。

4

3 回答 3

3

退房[[UIDevice currentDevice] systemVersion]。这将包含版本字符串。

于 2009-07-01T10:13:59.630 回答
2
#ifndef __IPHONE_3_0
#define __IPHONE_3_0 30000
#endif
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_0
    [[startButton titleLabel] setFont:playFont];
#else
    [startButton setFont:playFont];
#endif
于 2010-08-04T07:42:22.417 回答
1

根据您要执行的操作,最好测试功能而不是特定版本。

于 2009-07-01T10:20:25.967 回答