Ios-iphone System version number-iphone app version number

Source: Internet
Author: User

Reprint: http://blog.sina.com.cn/s/blog_7b9d64af0101bu9j.html

Many times, we need to get the user's iphone version number, or the app's current version number. Care about the following two aspects: first, the application logic will be based on the iphone hardware version number to deal with the corresponding! Second, we need to get the current version of our app because of some kind of demand. first, obtain the hardware version number of the client user

Determine the iOS version number of the device

float Version = [[[Uidevice Currentdevice] systemversion] floatvalue];

NSLog (@ "%f", version);

Second, we can also obtain more appropriate equipment information

NSLog (@ "%@", [[Uidevice Currentdevice] name]); Name of the phone as named by user

NSLog (@ "%@", [[Uidevice Currentdevice] uniqueidentifier]); A GUID like string

NSLog (@ "%@", [[Uidevice Currentdevice] identifierforvendor]); A GUID like string (IOS 6.0)

NSLog (@ "%@", [[Uidevice Currentdevice] systemName]); "IPhone OS"

NSLog (@ "%@", [[Uidevice Currentdevice] systemversion]); "5.1.1"

NSLog (@ "%@", [[Uidevice Currentdevice] model]); "IPhone" on both devices

NSLog (@ "%@", [[Uidevice Currentdevice] localizedmodel]); "IPhone" on both devices

Third, get the app version number

Get the version number of the software,

nsdictionary* infodict =[[nsbundle Mainbundle] infodictionary];

float Softverson =[[infodict objectforkey:@ "cfbundleshortversionstring"] floatvalue];

Reads the information for the Info.plist file.

nsdictionary* infodict =[[nsbundle Mainbundle] infodictionary];

Ios-iphone System version number-iphone app version number

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.