首页 > 代码库 > iOS 设备判断 最新统计代码
iOS 设备判断 最新统计代码
- (NSString*) deviceName
{
struct utsname systemInfo;
uname(&systemInfo);
NSString* code = [NSString stringWithCString:systemInfo.machine
encoding:NSUTF8StringEncoding];
static NSDictionary* deviceNamesByCode = nil;
if (!deviceNamesByCode) {
deviceNamesByCode = @{@"i386" :@"Simulator",
@"iPod1,1" :@"iPodTouch1", // (Original)
@"iPod2,1" :@"iPodTouch2", // (Second Generation)
@"iPod3,1" :@"iPodTouch3", // (Third Generation)
@"iPod4,1" :@"iPodTouch4", // (Fourth Generation)
@"iPhone1,1" :@"iPhone2G11", // (Original)
@"iPhone1,2" :@"iPhone3G12", // (3G)
@"iPhone2,1" :@"iPhone3GS21", // (3GS)
@"iPad1,1" :@"iPad", // (Original)
@"iPad2,1" :@"iPad2", //
@"iPad3,1" :@"iPad", // (3rd Generation)
@"iPhone3,1" :@"iPhone431",//
@"iPhone3,2" :@"iPhone432",
@"iPhone3,3" :@"iPhone433",
@"iPhone4,1" :@"iPhone4S41",//
@"iPhone4,2" :@"iPhone442",
@"iPhone4,3" :@"iPhone443",
@"iPhone5,1" :@"iPhone551", // (model A1428, AT&T/Canada)
@"iPhone5,2" :@"iPhone552",
@"iPad3,4" :@"iPad", // (4th Generation)
@"iPad2,5" :@"iPadMini", // (Original)
@"iPhone5,3" :@"iPhone5C53", // (model A1456, A1532 | GSM)
@"iPhone5,4" :@"iPhone5C54", // (model A1507, A1516, A1526 (China), A1529 | Global)
@"iPhone6,1" :@"iPhone5S61", // (model A1433, A1533 | GSM)
@"iPhone6,2" :@"iPhone5S62", // (model A1457, A1518, A1528 (China), A1530 | Global)
@"iPad4,1" :@"iPadAir", // 5th Generation iPad (iPad Air) - Wifi
@"iPad4,2" :@"iPadAir", // 5th Generation iPad (iPad Air) - Cellular
@"iPad4,4" :@"iPadMini", // (2nd Generation iPad Mini - Wifi)
@"iPad4,5" :@"iPadMini" // (2nd Generation iPad Mini - Cellular)
};
}
小伙伴们快去试试吧!~
iOS 设备判断 最新统计代码
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。