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