[Ios]ios get device information frequently used

Source: Internet
Author: User

Shimen the Lord to contribute. Respect the work of the author. Please do not reprint.

Suppose the article is helpful to you. You are welcome to donate to the author. Support Shimen Master. The donation amount is arbitrary, heavy in the mind ^_^

I want to donate: Click Donate

Cocos2d-x source code Download: Dot I teleport

Games Official Download:HTTP://DWZ.CN/RWTJL

Game video preview:http://dwz.cn/RzHHd

Game Development Blog:Http://dwz.cn/RzJzI

Game Source code transfer : Http://dwz.cn/Nret1


1. Regular usage

NSLog (@ "HostName:%@", [[Nsprocessinfo ProcessInfo] HostName]);//globallyuniquestring Unique identifier, each call will be different, Can be used as some temporary cache file name NSLog (@ "globaluniquestring:%@", [[Nsprocessinfo ProcessInfo] globallyuniquestring]);//operating system name NSLog ( @ "Operatingsystemname:%@", [[Nsprocessinfo ProcessInfo] operatingsystemname]);//operating system version number NSLog (@ " operatingSystemVersion:%@ ", [[[Nsprocessinfo ProcessInfo] operatingsystemversionstring]);//Physical Memory NSLog (@" Physicalmem :%llu ", [[[Nsprocessinfo ProcessInfo] physicalmemory]);//Process name NSLog (@" ProcessName:%@ ", [[Nsprocessinfo ProcessInfo] ProcessName]);//supplier Identification NSLog (@ "UniqueId:%@", [Uidevice Currentdevice].identifierforvendor);//device type (IPhone, IPAD) NSLog (@ "Userinterfaceidiom:%d", [Uidevice Currentdevice].userinterfaceidiom);//Device name NSLog (@ "Name:%@", [ Uidevice currentdevice].name);//System name NSLog (@ "SystemName:%@", [Uidevice currentdevice].systemname);//System version number NSLog (@ " Systemversion:%@ ", [Uidevice currentdevice].systemversion);//Model NSLog (@" model:%@ ", [Uidevice Currentdevice].model) ;//localized Model NSLog (@"Localizemodel:%@", [Uidevice Currentdevice].localizedmodel);//battery Status NSLog (@ "Batterylevel:%f", [Uidevice Currentdevice].batterylevel);

2. Infer if the device is more than 9.0 systems
[[[Uidevice Currentdevice] systemversion] floatvalue] >= 9.0f
Note:
If our device version number is 9.1.1 (string type), the value of the Floatvalue float is 9.100000.


3. Infer if the device is an iphone, IPad
Ipad:[[uidevice Currentdevice] userinterfaceidiom] = = Uiuserinterfaceidiompadiphone: [[UIDevice CurrentDevice] USERINTERFACEIDIOM] = = Uiuserinterfaceidiomphoneuiuserinterfaceidiom in Uidevice.htypedef NS_ENUM (NSInteger, UIUSERINTERFACEIDIOM) {#if __iphone_3_2 <= __iphone_os_version_max_allowed    uiuserinterfaceidiomphone,           / /IPhone and IPod touch style UI    uiuserinterfaceidiompad,             //IPad style ui#endif};

Shimen the main contribution, respect the work of the author, please do not reprint.

If the article is helpful to you, you are welcome to donate to the author, support Shimen, and donate any amount. Heavy on the mind ^_^

I want to donate: Click Donate

Cocos2d-x source code Download: Dot I teleport

Games Official Download:HTTP://DWZ.CN/RWTJL

Game video preview:http://dwz.cn/RzHHd

Game Development Blog:Http://dwz.cn/RzJzI

Game Source code transfer : Http://dwz.cn/Nret1

[Ios]ios get device information frequently used

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.