有没有办法确定运行应用程序的设备.我想区分iPhone和iPod Touch,如果可能的话.
在我的应用程序(用Objective-C编写)中,如何检测设备是iPhone,iPad还是iPhone5?
if([[UIDevice currentDevice]userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
// [iphone] or [itouch]
} else {
// [ipad]
}
Run Code Online (Sandbox Code Playgroud)