3

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

AleMal
  • 1,977
  • 6
  • 24
  • 49
  • 4
    You can find most of them here: https://github.com/erica/uidevice-extension/blob/master/UIDevice-Hardware.m – Luke Nov 18 '11 at 17:05

2 Answers2

6

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]);
DShah
  • 9,768
  • 11
  • 71
  • 127
0

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

djunod
  • 4,876
  • 2
  • 34
  • 28