使用 iOS 确定设备(iPhone、iPod Touch) [英] Determine device (iPhone, iPod Touch) with iOS
本文介绍了使用 iOS 确定设备(iPhone、iPod Touch)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法确定运行应用程序的设备.如果可能,我想区分 iPhone
和 iPod Touch
.
Is there a way to determine the device running an application. I want to distinguish between iPhone
and iPod Touch
, if possible.
推荐答案
您可以使用 UIDevice
这样的类:
You can use the UIDevice
class like this:
NSString *deviceType = [UIDevice currentDevice].model;
if([deviceType isEqualToString:@"iPhone"])
// it's an iPhone
这篇关于使用 iOS 确定设备(iPhone、iPod Touch)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文