siruoxian 发表于 2013-1-30 20:33:22

获取iphone手机型号

需要在头文件中引入

#include <sys/types.h>
#include <sys/sysctl.h>
 
  size_t size; 
        int nR = sysctlbyname("hw.machine", NULL, &size, NULL, 0);
        char *machine = (char *)malloc(size);
        nR = sysctlbyname("hw.machine", machine, &size, NULL, 0);
        NSString *platform = [NSString stringWithCString:machine encoding:NSUTF8StringEncoding];
        NSLog(@"platform:%@",platform);
        free(machine);
页: [1]
查看完整版本: 获取iphone手机型号