gpt4 book ai didi

iphone - ios设备名称列表

转载 作者:行者123 更新时间:2023-12-03 19:36:41 24 4
gpt4 key购买 nike

我在我的应用程序中使用了这个函数来返回我的设备的型号名称并且工作得很好,但是我如何找到这个函数返回值的完整列表(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;

谢谢

最佳答案

您还可以使用 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]);

关于iphone - ios设备名称列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8186025/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com