-(nsstring*) devicename{ struct utsname systeminfo; uname (&systeminfo ); nsstring* code = [NSString stringwithcstring:systeminfo.machine & nbsp ENCODING:N sutf8stringencoding]; static nsdictionary* Devicenamesbycode = nil; if (!devicenamesbycode) { Devicenamesbycode = @{ @ "i386" :@ "Simulator", &NB Sp @ "ipod1,1" : @ "IPodTouch1", //(Original) @ "ipod2,1" : @ "IPODTOUCH2", &NB sp;//(Second GeneratioN) @ "ipod3,1" &nbs P : @ "IPodTouch3", //(third Generation) &N Bsp @ "ipod4,1" : @ "IPODTOUCH4", //(fourth Generation) &nbs P @ "iphone1,1": @ "iphone2g11", &N Bsp //(Original) &NBSP ; @ "iphone1,2": @ "Iphone3g12", //(3G) &NB Sp @ "iphone2,1": @ "Iphone3gs21", & nbsp //(3GS) @ "ipad1,1" : @ "IPad", //(Original) &NBS P @ "ipad2,1" : @ "iPad2", &N bsp;// @ "ipad3,1" : @ "IPad", //(3rd Generation) &NB Sp @ "iphone3,1": @ "iPhone431",// &N Bsp @ "iphone3,2": @ "iPhone432", &NBS P @ "iphone3,3": @ "iPhone433",   ; @ "iphone4,1": @ "iphone4s41",// & nbsp   @ "iphone4,2": @ "iPhone442", &nbs P @ "iphone4,3": @ "iPhone443", &nbs P @ "iphone5,1": @ "IPhone55 1 ", //(model A1428, At&t/canada) &N Bsp @ "iphone5,2": @ "iPhone552", &NBS P @ "ipad3,4" : @ "IPad" //( 4th Generation @ " ipad2,5 " : @" Ipadmini ", //(Original) &N Bsp @ "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 &NBSp @ "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) }; }
Come on, boys, try it,!~.
IOS device to determine the latest stats code