zoukankan      html  css  js  c++  java
  • iOS获取设备信息

        NSString *strName = [[UIDevice currentDevice] name]; // Name of the phone as named by user
        
        
        NSString *strSysName = [[UIDevice currentDevice] systemName]; // "iPhone OS"
        
        NSString *strSysVersion = [[UIDevice currentDevice] systemVersion]; // "2.2.1"
        
        NSString *strModel = [[UIDevice currentDevice] model]; // "iPhone" on both devices
        
        NSString *strLocModel = [[UIDevice currentDevice] localizedModel]; // "iPhone" on both devices
        
        float version = [[[UIDevice currentDevice] systemVersion] floatValue];
        
        
        
        NSLog(@"\nstrName=%@  \nstrSysName=%@  \nstrSysVersion=%@  \nstrModel=%@  \nstrLocModel=%@  \nversion=%f",strName,strSysName,strSysVersion,strModel,strLocModel,version);


    //打印结果

    strName=haijie的 iPhone  
    strSysName=iPhone OS  
    strSysVersion=8.4  
    strModel=iPhone  
    strLocModel=iPhone  
    version=8.400000

     
  • 相关阅读:
    C语言之回调函数&模块化
    680. 验证回文字符串 Ⅱ
    C++指针数组和数组指针
    345. 反转字符串中的元音字母
    633.平方数之和
    IDM使用介绍篇
    路由器无线桥接WDS
    约数的个数
    密码翻译
    查找学生信息
  • 原文地址:https://www.cnblogs.com/haijieFeng/p/4736268.html
Copyright © 2011-2022 走看看