High-version macro detection in iOS development

Source: Internet
Author: User

In framework development, in order to adapt to the lowest system version, we need to be careful not to use the High version API. But in addition to personal attention, is it possible to be prompted by the system at compile time to exceed the compatible version of API usage?

After observing the Cf_available_ios macro, we gave the following solution, which is to change the iOS SDK. The specific options are as follows:

Add Location: frameworks-> corefoundation, CFAvalailability.h line 115 Add code:

/* Added by Mitty */

#define __NEP_2_0 Availability (ios,introduced=2.0)

#define __NEP_2_1 Availability (ios,introduced=2.1)

#define __NEP_2_2 Availability (ios,introduced=2.2)

#define __NEP_3_0 Availability (ios,introduced=3.0)

#define __NEP_3_1 Availability (ios,introduced=3.1)

#define __NEP_3_2 Availability (ios,introduced=3.2)

#define __NEP_4_0 Availability (ios,introduced=4.0)

#define __NEP_4_1 Availability (ios,introduced=4.1)

#define __NEP_4_2 Availability (ios,introduced=4.2)

#define __NEP_4_3 Availability (ios,introduced=4.3)

#define __NEP_5_0 Availability (ios,introduced=5.0)

#define __nep_5_1 Availability (ios,introduced=5.1)

#define __NEP_6_0 Availability (ios,introduced=6.0)

#define __nep_6_1 Deprecated ("API version newer than iOS6.0")

#define __NEP_7_0 Deprecated ("API version newer than iOS6.0")

#define __nep_7_1 Deprecated ("API version newer than iOS6.0")

#define __NEP_8_0 Deprecated ("API version newer than iOS6.0")

#define __NEP_8_1 Deprecated ("API version newer than iOS6.0")

#define __nep_8_2 Deprecated ("API version newer than iOS6.0")

#define __NEP_8_3 Deprecated ("API version newer than iOS6.0")

#define __NEP_9_0 Deprecated ("API version newer than iOS6.0")

#define __NEP_9_1 Deprecated ("API version newer than iOS6.0")

#define __NEP_10_0 Deprecated ("API version newer than iOS6.0")

#define __NEP_10_1 Deprecated ("API version newer than iOS6.0")

#define __nep_10_2 Deprecated ("API version newer than iOS6.0")

#define __NEP_10_3 Deprecated ("API version newer than iOS6.0")

#define __NEP_10_4 Deprecated ("API version newer than iOS6.0")

#define __NEP_10_5 Deprecated ("API version newer than iOS6.0")

#define __NEP_10_6 Deprecated ("API version newer than iOS6.0")

#define __NEP_10_7 Deprecated ("API version newer than iOS6.0")

#define __NEP_10_8 Deprecated ("API version newer than iOS6.0")

#define __NEP_10_9 Deprecated ("API version newer than iOS6.0")

#define __NEP_10_10 Deprecated ("API version newer than iOS6.0")

#define Cf_available_ios (_ios) \

__attribute__ ((, __nep_# #_ios))

/* Added by Mitty End */

High-version macro detection in iOS development

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.