First, there are three ways to obtain the device model:
===== Device Model: Method One ========
NSString * Strmodel = [Uidevice currentdevice].model; NSLog (@ "model:%@", Strmodel); NSLog (@ "Localizedmodel:%@", [[Uidevice Currentdevice] localizedmodel]);
===== Device Model: Method Two =========
struct Utsname systeminfo;uname (&systeminfo); NSString *devicestring = [NSString stringWithCString:systemInfo.machine encoding:nsutf8stringencoding]; NSLog (@ "systeminfo.machine:%@", devicestring);
===== Device Model: Method three (model) =========
size_t size;sysctlbyname ("Hw.machine", NULL, &size, NULL, 0); char *model = (char *) malloc (size); Sysctlbyname ("hw.m Achine ", model, &size, NULL, 0); NSString * StrModel3 = [NSString Stringwithcstring:model encoding:nsutf8stringencoding];free (model); NSLog (@ "hw.machine-model:%@", strModel3);
===== Device Model: Method three (machine) =========
Char *machine = (char*) malloc (size), Sysctlbyname ("Hw.machine", Machine, &size, NULL, 0); NSString *platform = [NSString stringwithcstring:machine encoding:nsutf8stringencoding];free (machine); NSLog (@ "hw.machine-platform:%@", platform);
Get device model, app information, System Information