這是檢測用戶正在運行的設備的正確方法?檢測設備型號(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