iOS开发中常用型号标识符

如果有错误或者不完整的地方欢迎大家指出

-(NSString*)deviceVersion

{

structutsnamesystemInfo;

uname(&systemInfo);

NSString*deviceString = [NSStringstringWithCString:systemInfo.machineencoding:NSUTF8StringEncoding];

//CLog(@"%@",deviceString);

if([deviceStringisEqualToString:@"iPhone1,1"])return@"iPhone 1G";

if([deviceStringisEqualToString:@"iPhone1,2"])return@"iPhone 3G";

if([deviceStringisEqualToString:@"iPhone2,1"])return@"iPhone 3GS";

if([deviceStringisEqualToString:@"iPhone3,1"])return@"iPhone 4";

if([deviceStringisEqualToString:@"iPhone3,2"])return@"Verizon iPhone 4";

if([deviceStringisEqualToString:@"iPhone4,1"])return@"iPhone 4S";

if([deviceStringisEqualToString:@"iPhone5,2"])return@"iPhone 5";

if([deviceStringisEqualToString:@"iPhone5,3"] || [deviceStringisEqualToString:@"iPhone5,4"])return@"iPhone 5C";

if([deviceStringisEqualToString:@"iPhone6,2"])return@"iPhone 5S";

if([deviceStringisEqualToString:@"iPhone7,2"])return@"iPhone 6";

if([deviceStringisEqualToString:@"iPhone7,1"])return@"iPhone6 Plus";

if([deviceStringisEqualToString:@"iPhone8,1"])return@"iPhone 6s";

if([deviceStringisEqualToString:@"iPhone8,2"])return@"iPhone6s Plus";

if([deviceStringisEqualToString:@"iPhone8,4"])return@"iPhone SE";

if([deviceStringisEqualToString:@"iPhone9,1"])return@"iPhone 7";

if([deviceStringisEqualToString:@"iPhone9,2"])return@"iPhone7 Plus";

if([deviceStringisEqualToString:@"iPod1,1"])return@"iPod Touch 1G";

if([deviceStringisEqualToString:@"iPod2,1"])return@"iPod Touch 2G";

if([deviceStringisEqualToString:@"iPod3,1"])return@"iPod Touch 3G";

if([deviceStringisEqualToString:@"iPod4,1"])return@"iPod Touch 4G";

if([deviceStringisEqualToString:@"iPad1,1"])return@"iPad";

if([deviceStringisEqualToString:@"iPad2,1"])return@"iPad 2 (WiFi)";

if([deviceStringisEqualToString:@"iPad2,2"])return@"iPad 2 (GSM)";

if([deviceStringisEqualToString:@"iPad2,3"])return@"iPad 2 (CDMA)";

if([deviceStringisEqualToString:@"iPad3,4"])return@"iPad 4 (WiFi)";

if([deviceStringisEqualToString:@"iPad4,1"])return@"iPad Air";

if([deviceStringisEqualToString:@"iPad5,3"] || [deviceStringisEqualToString:@"iPad5,4"])return@"iPad Air 2";

if([deviceStringisEqualToString:@"iPad6,3"] || [deviceStringisEqualToString:@"iPad6,4"])return@"iPad Pro(9.7)";

if([deviceStringisEqualToString:@"iPad6,7"] || [deviceStringisEqualToString:@"iPad6,8"])return@"iPad Pro(12.9)";

if([deviceStringisEqualToString:@"i386"])return@"Simulator";

if([deviceStringisEqualToString:@"x86_64"])return@"Simulator";

//CLog(@"NOTE: Unknown device type: %@", deviceString);

returndeviceString;

}

你可能感兴趣的:(iOS开发中常用型号标识符)