IOS- 得到系统版本

来源:互联网 发布:程序员如何年薪百万 编辑:程序博客网 时间:2024/05/01 00:13
-(void)getSystemInfo{    size_t size;    sysctlbyname("hw.machine", NULL, &size, NULL, 0);    char *machine = (char*)malloc(size);    sysctlbyname("hw.machine", machine, &size, NULL, 0);    NSString *platform = [NSString stringWithCString:machine encoding:NSUTF8StringEncoding];    machine = nil;    NSString *strSysName = [[UIDevice currentDevice] systemVersion];    [AppManager setUserDefaultsValue:platform key:@"phoneType"];    [AppManager setUserDefaultsValue:strSysName key:@"phoneSystem"];    [AppManager setUserDefaultsValue:g_versionSNO key:@"version"];    platform = nil;    strSysName = nil;}
0 0
原创粉丝点击