1、获取设备的具体型号
头文件:
//设备具体型号需要
#import <sys/sysctl.h>
方法:
+ (NSString *) platformName{
// NSString *platform = [TPLStatisticsUtil platform];
//获得原始机器识别信息
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 encoding:NSUTF8StringEncoding];
free(machine);
return platform;
//由机器原始识别信息自己设定对应的
if ([platform isEqualToString:@"iPhone1,1"])
return @"iPhone 1G";
if ([platform isEqualToString:@"iPhone1,2"])
return @"iPhone 3G";
if ([platform isEqualToString:@"