本文介绍了使用 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)
发布评论