gpt4 book ai didi

iPhone 设备一代

转载 作者:行者123 更新时间:2023-12-03 19:40:56 26 4
gpt4 key购买 nike

我有以下代码

@implementation UIDevice(machine)

- (NSString *)machine
{
size_t size;

// Set 'oldp' parameter to NULL to get the size of the data
// returned so we can allocate appropriate amount of space
sysctlbyname("hw.machine", NULL, &size, NULL, 0);

// Allocate the space to store name
char *name = malloc(size);

// Get the platform name
sysctlbyname("hw.machine", name, &size, NULL, 0);

// Place name into a string
NSString *machine = [NSString stringWithCString:name];

// Done with this
free(name);

return machine;
}

@end

/* ... */

NSLog(@"device: %@", [[UIDevice currentDevice] machine]);

我得到的输出为:

Platforms:
-----------
iPhone1,1
iPhone1,2
iPod1,1
iPod2,1

iPhone/iPod touch 后附加的两个数字表示什么,即 (1,1 ) 、(1,2) 等?

谢谢比兰奇

最佳答案

iPhone1,1:iPhone(原装)
iPhone1,2:iPhone 3G
iPhone2,1:iPhone 3GS
iPhone3,1:iPhone 4
iPhone4,1:iPhone 4S

iPod1,1:iPod touch(原装)
iPod2,1:iPod touch(第二代)
iPod3,1:iPod touch(第三代)
iPod4,1:iPod touch(第四代)

iPad1,1:iPad(原版)
iPad2,1:iPad 2
iPad3,1:iPad(第三代)

关于iPhone 设备一代,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1713480/

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