iOS获取设备信息的常用方法

参考链接 : http://childhood.logdown.com/posts/208216/ios-access-device-information-summary-of-commonly-used-methods

//globallyUniqueString 唯一标示符,每次调用都会不一样
[[NSProcessInfo processInfo] globallyUniqueString];
//操作系统名称
[[NSProcessInfo processInfo] operatingSystemName];
//操作系统版本
[[NSProcessInfo processInfo] operatingSystemVersionString];

//物理内存
[[NSProcessInfo processInfo] physicalMemory];
//进程名称
[[NSProcessInfo processInfo] processName];
//供应商标识
[[UIDevice currentDevice] identifierForVendor];

//设备名称
[[UIDevice currentDevice] userInterfaceIdiom];
//设备类型
[[UIDevice currentDevice] name];
//系统名称
[[UIDevice currentDevice] systemName];
//系统版本
[[UIDevice currentDevice] systemVersion];

//模型 iPad or iPhone
[[UIDevice currentDevice] model];
//本地化模型
[[UIDevice currentDevice] localizedModel];
//电池状态
[[UIDevice currentDevice] batteryLevel];


//判断设置是否是7.0以上版本
[[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0f;

//判断设置是否是iPhone 或者iPad TV
[[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad;

[[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone;

[[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomTV;
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的阅读 13,566评论 5 6
  • 经过今天的思维导图品鉴,觉得自己确实欠缺不少。比如纸张就不对!每个线条断舍离要多注意,这其实是一种感受和技巧。还有...
    南京鲁辰阅读 428评论 2 4
  • 好久没提笔,不是不想写,只是幸福的没空记起…偶尔偷闲坐着发呆,脑子里也只会闪烁近日的点滴。这就是最近的我:由内向外...
    猪牛兽阅读 243评论 2 2
  • 腾哥 英语 教材:早上2a unit6的one tow buckle my shoes,晚上 0a循环听 输出:早...
    疼福妈阅读 155评论 0 0
  • 我所在的南方,十月的夜晚已经渐起凉意,终于嗅到了秋天的气息。 南方的秋天依然艳阳高照,只是风比夏天多了一丝清凉。 ...
    四月Apr阅读 509评论 0 0