【问题标题】:List of ios device nameios设备名称列表
【发布时间】:2024-01-19 21:10:01
【问题描述】:

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

谢谢

【问题讨论】:

标签: iphone ipad device hardware-id


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    Here's 显示所有硬件标识符的更新列表。

    【讨论】: