我可以想到的一种方式是使用:
[[UIDevice currentDevice] model];
并检测字符串@“iPad”的存在 – 这似乎有点脆弱。
在3.2 SDK中,我看到UIDevice也有一个属性,这是我真正想要的,但不工作前3.2(显然):
[[UIDevice currentDevice] userInterfaceIdiom];
有没有其他方法来检查@“iPad”的普遍应用程序的存在?
解决方法 CheckoutUI_USER_INTERFACE_IDIOM
。 Returns the interface idiom supported by the current device.
Return Value
UIUserInterfaceIdiomPhone
if the device is an iPhone or iPod touch orUIUserInterfaceIdiomPad
if the device is an iPad.07001
The type of interface that should be used on the current device
typedef enum { UIUserInterfaceIdiomPhone,UIUserInterfaceIdiomPad,} UIUserInterfaceIdiom;总结
以上是内存溢出为你收集整理的API来确定是否在iPhone或iPad上运行全部内容,希望文章能够帮你解决API来确定是否在iPhone或iPad上运行所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)