-3

当我尝试在这里定义我的常量时,我​​对 iPod 没有任何经验:

#define isIPhone (![[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] || [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)

谁能知道如何定义 iPod 型号?

4

1 回答 1

0

使用 [UIDevice currentDevice] 的属性: UIDevice 参考

基于分辨率的分支绝对是一个坏主意。

另请参阅:UIDevice currentDevice 模型可能的值

由于此信息不会在运行时更改,因此值得在开始时查询一次,而不是在每个特定条件下调用相应的 API。

于 2013-06-13T19:13:57.383 回答