iphone - iOS中如何获取设备型号?

标签 iphone objective-c ios7 model

我想通过代码获取设备型号(设置->常规->关于->型号)。我用过:

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

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

enter image description here

最佳答案

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/

相关文章:

iphone - 如何在 iPhone 上使用 OpenAL 播放循环声音

iphone - iPhone 版 CometD/Bayeux 客户端

ios - 设置 UICollectionViewController 时出错 - nib 但未获得 UICollectionView

ios - 从 JSON 中获取递归的 NSDictionaries 和 NSArray

ios - 我无法通过标签 objective-c 更改标签文本

ios - UITextField/UITextView/UISearchBar 上的死锁/硬卡住成为FirstResponder

objective-c - 单击主页按钮时,应用程序崩溃

ios - 以编程方式更改为从右到左的 RTL

ios - 根据内容调整 UILabel 的大小

objective-c - 修补 Mach-o 二进制文件