3

アプリでこの関数を使用して、デバイスのモデル名を返し、非常にうまく機能しますが、この関数の戻り値の完全なリストを見つける方法 (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; 

ありがとう

4

2 に答える 2

6

UIDevice以下のように、クラスを使用してモバイル OS のすべての詳細を取得するために使用することもできます。

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]);
于 2011-11-18T17:03:08.583 に答える
0

すべてのハードウェア識別子を示す更新されたリストを次に示します。

于 2013-10-10T00:08:44.757 に答える