У меня есть следующий код
@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, i, e (1,1), (1,2) и т. Д.?
Спасибо
Biranchi