我希望通过编程获取设备型号(设置->通用->关于本机->型号)
。我尝试使用以下代码:
NSString* model=[[UIDevice currentDevice] model];
上面的代码返回的是“iPhone”。但我需要获取设备型号的值,该值显示在(设置->通用->关于本机->型号)
中。例如,在我的iPhone中,它是“MD128HN/A”。请参见附加的快照。
我希望通过编程获取设备型号(设置->通用->关于本机->型号)
。我尝试使用以下代码:
NSString* model=[[UIDevice currentDevice] model];
上面的代码返回的是“iPhone”。但我需要获取设备型号的值,该值显示在(设置->通用->关于本机->型号)
中。例如,在我的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);