//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
本文介绍了一种使用Objective-C编程语言来获取iOS设备型号和系统版本的方法。通过调用`uname`函数并结合`UIDevice`类,可以有效地读取到如设备型号(machine)和系统版本(systemVersion)等信息。

1352

被折叠的 条评论
为什么被折叠?



