如何在iOS中获取设备型号?

时间:2014-02-26 09:57:21

标签: iphone objective-c ios7 model

我希望通过代码获取设备模型(Settings->General->About->Model)。我用过:

 NSString*  model=[[UIDevice currentDevice] model];

以上代码返回“iPhone”。但我需要获得(Settings->General->About->Model)中显示的设备模型值。例如在我的iPhone中它是“MD128HN / A.请参阅附件快照。

enter image description here

1 个答案:

答案 0 :(得分:0)

NSString *platform = [UIDevice currentDevice].model;

NSLog(@"[UIDevice currentDevice].model: %@",platform);
NSLog(@"[UIDevice currentDevice].description: %@",[UIDevice currentDevice].description);
NSLog(@"[UIDevice currentDevice].localizedModel: %@",[UIDevice currentDevice].localizedModel);
NSLog(@"[UIDevice currentDevice].name: %@",[UIDevice currentDevice].name);
NSLog(@"[UIDevice currentDevice].systemVersion: %@",[UIDevice currentDevice].systemVersion);
NSLog(@"[UIDevice currentDevice].systemName: %@",[UIDevice currentDevice].systemName);