美文网首页
iOS获取设备信息的常用方法

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

作者: e40c669177be | 来源:发表于2016-06-02 14:35 被阅读644次

参考链接 : 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;

相关文章

网友评论

      本文标题:iOS获取设备信息的常用方法

      本文链接:https://www.haomeiwen.com/subject/qlburttx.html