使用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.
推荐答案
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屋!
查看全文