zoukankan      html  css  js  c++  java
  • UIDevice获取设备数据以及如何获取应用信息


    // 硬件信息
    [UIDevice platform];//平台
    [UIDevice cpuFrequency]];//cpu信息
    UIDevice busFrequency]];//总线
    [UIDevice totalMemory]];//总内存
    UIDevice userMemory]];//已经使用的内存
    //设备相关信息的获取
        NSString *strName = [[UIDevice currentDevice] name];
        NSLog(@"设备名称:%@", strName);
        
        NSString *strId = [[UIDevice currentDevice] uniqueIdentifier];
        NSLog(@"设备唯一标识:%@", strId);
        
        NSString *strSysName = [[UIDevice currentDevice] systemName];
        NSLog(@"系统名称:%@", strSysName);
        
        NSString *strSysVersion = [[UIDevice currentDevice] systemVersion];
        NSLog(@"系统版本号:%@", strSysVersion);
        
        NSString *strModel = [[UIDevice currentDevice] model];
        NSLog(@"设备模式:%@", strModel);
        
        NSString *strLocModel = [[UIDevice currentDevice] localizedModel];
        NSLog(@"本地设备模式:%@", strLocModel);
        
        float version = [[[UIDevice currentDevice] systemVersion] floatValue];
        NSLog(@"版本号:%f
    ", version);
        
        //app应用相关信息的获取
        NSDictionary *dicInfo = [[NSBundle mainBundle] infoDictionary];
    //    CFShow(dicInfo);
        
        NSString *strAppName = [dicInfo objectForKey:@"CFBundleDisplayName"];
        NSLog(@"App应用名称:%@", strAppName);
        
        NSString *strAppVersion = [dicInfo objectForKey:@"CFBundleShortVersionString"];
        NSLog(@"App应用版本:%@", strAppVersion);
        
        NSString *strAppBuild = [dicInfo objectForKey:@"CFBundleVersion"];
        NSLog(@"App应用Build版本:%@", strAppBuild);
  • 相关阅读:
    快速切题 sgu102.Coprimes 欧拉函数 模板程度 难度:0
    快速切题 sgu104. Little shop of flowers DP 难度:0
    poj 1163 The Triangle 搜索 难度:0
    sgu101 欧拉路径 难度:1
    快速切题 poj3414 Pots
    xml学习
    linux
    常用排序算法
    C++面试题目
    软件工程的一些问题
  • 原文地址:https://www.cnblogs.com/needly/p/3407781.html
Copyright © 2011-2022 走看看