这是检测用户正在运行的设备的正确方法?检测设备型号(iPhone/iPod Touch)的正确方法?
NSString *currentModel = [[UIDevice currentDevice] model];
if ([currentModel isEqualToString:@"iPhone"]) {
// The user is running on iPhone so allow Call, Camera, etc.
} else {
// The user is running on a different device (iPod/iPad/iPhone Simulator) disallow Call.
}
这似乎是这个问题的重复:http://stackoverflow.com/questions/688001/how-to-tell-if-your-code-is-running-on-an-iphone-or-an -iphone3g – 2010-03-15 18:06:46