ios设备名称列表

发布于 2024-12-16 12:52:14 字数 403 浏览 3 评论 0原文

我在我的应用程序中使用了这个函数来返回我的设备的型号名称并且工作得很好,但是我如何找到这个函数返回值的完整列表(es for iphone3,3gs,4s,ipad,ipad2,ipod ecc ecc

size_t size;  
sysctlbyname("hw.machine", NULL, &size, NULL, 0);  
char *machine = malloc(size);  
sysctlbyname("hw.machine", machine, &size, NULL, 0);  
NSString *platform = [NSString stringWithCString:machine];  
free(machine);  
return platform; 

谢谢

i have used this function in my app for return the model name of my device and work very well, but how i can find a complete list of the returned value for this function (es for iphone3,3gs,4s,ipad,ipad2,ipod ecc ecc

size_t size;  
sysctlbyname("hw.machine", NULL, &size, NULL, 0);  
char *machine = malloc(size);  
sysctlbyname("hw.machine", machine, &size, NULL, 0);  
NSString *platform = [NSString stringWithCString:machine];  
free(machine);  
return platform; 

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

断桥再见 2024-12-23 12:52:14

您还可以使用 UIDevice 类获取移动操作系统的所有详细信息,如下所示:

NSLog(@"uniqueIdentifier: %@", [[UIDevice currentDevice] uniqueIdentifier]);
NSLog(@"name: %@", [[UIDevice currentDevice] name]);
NSLog(@"systemName: %@", [[UIDevice currentDevice] systemName]);
NSLog(@"systemVersion: %@", [[UIDevice currentDevice] systemVersion]);
NSLog(@"model: %@", [[UIDevice currentDevice] model]);
NSLog(@"localizedModel: %@", [[UIDevice currentDevice] localizedModel]);

You can also use to get the all details of your mobile OS using UIDevice class as below:

NSLog(@"uniqueIdentifier: %@", [[UIDevice currentDevice] uniqueIdentifier]);
NSLog(@"name: %@", [[UIDevice currentDevice] name]);
NSLog(@"systemName: %@", [[UIDevice currentDevice] systemName]);
NSLog(@"systemVersion: %@", [[UIDevice currentDevice] systemVersion]);
NSLog(@"model: %@", [[UIDevice currentDevice] model]);
NSLog(@"localizedModel: %@", [[UIDevice currentDevice] localizedModel]);
用心笑 2024-12-23 12:52:14

这里显示了所有硬件标识符的更新列表。

Here's an updated list that shows all the hardware identifiers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文