IOS开发获得设备类型和系统版本号

//here use sys/utsname.h

struct utsname systemInfo;

uname(&systemInfo);

//get the device model and the system version

NSLog(@"%@", [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]);

NSLog!@"%@", [[UIDevice currentDevice] systemName]); //IOS

NSLog(@"%@", [[UIDevice currentDevice] systemVersion]); //5.1

你可能感兴趣的:(ios,System,encoding)