我想通过代码获取设备型号(设置->常规->关于->型号)
。我用过:
NSString* model=[[UIDevice currentDevice] model];
以上代码返回“iPhone”。但我需要获取 (Settings->General->About->Model)
中显示的设备型号值。例如,在我的 iPhone 中,它是“MD128HN/A。请参阅随附的快照。
最佳答案
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);
关于iphone - iOS中如何获取设备型号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22037767/