ios-device type and system version

Source: Internet
Author: User

1. IPhone System version

1. Uidevice

@interface uidevice:nsobject+ (Uidevice *) Currentdevice; @property (nonatomic,readonly,retain) nsstring    *name;              Device name @property (nonatomic,readonly,retain) nsstring    *model;             e.g @ "iPhone" @ "IPod Touch" @property (nonatomic,readonly,retain) nsstring    *localizedmodel;    Localized version of Model@property (Nonatomic,readonly,retain) nsstring    *systemname;        e.g. @ "IOS" @property (nonatomic,readonly,retain) nsstring    *systemversion;     e.g. @ "4.0" @end
Code:
Uidevice *device = [Uidevice currentdevice]; NSLog (@ "%@", device.name); NSLog (@ "%@", Device.model); NSLog (@ "%@", Device.localizedmodel); NSLog (@ "%@", device.systemname); NSLog (@ "%@", device.systemversion);

2. Get the system version

Floor (Nsfoundationversionnumber)

System version:

#if target_os_iphone#define Nsfoundationversionnumber_iphoneos_2_0678.24#define Nsfoundationversionnumber_ Iphoneos_2_1  678.26#define nsfoundationversionnumber_iphoneos_2_2  678.29#define Nsfoundationversionnumber_iphoneos_3_0  678.47#define nsfoundationversionnumber_iphoneos_3_1  678.51# Define Nsfoundationversionnumber_iphoneos_3_2  678.60#define nsfoundationversionnumber_ios_4_0  751.32# Define Nsfoundationversionnumber_ios_4_1  751.37#define nsfoundationversionnumber_ios_4_2  751.49#define Nsfoundationversionnumber_ios_4_3  751.49#define nsfoundationversionnumber_ios_5_0  881.00#define Nsfoundationversionnumber_ios_5_1  890.10#define nsfoundationversionnumber_ios_6_0  992.00#define Nsfoundationversionnumber_ios_6_1  993.00#define nsfoundationversionnumber_ios_7_0 1047.20#define Nsfoundationversionnumber_ios_7_1 1047.25#endif
Example:

if (Floor (Nsfoundationversionnumber) < 993.0) {//IOS 6.1 or earlier} else {//ios 7 or later}


ios-device type and system version

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.