获取xcode 4.5以警告新的API调用 [英] Get xcode 4.5 to warn about new API calls
问题描述
这个问题的答案似乎不适用于xcode 4.5。总结一下,XCode是否有办法警告只有比部署目标更高版本的类,方法和程序?
The answer to this question does not appear to work on xcode 4.5. To summarise it, is there a way for XCode to warn about classes, methods and procedures that are only available a later version than the deployment target?
推荐答案
你所链接的问题里面有一个正确的答案。通过一些实验,我想出了这个(来自mattjgalloway的答案):
There is a correct answer inside of the question that you linked too. With some experimentation, I came up with this (from mattjgalloway's answer):
#define __AVAILABILITY_TOO_NEW __attribute__((deprecated("TOO NEW!"))) __attribute__((weak_import))
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0
#undef __AVAILABILITY_INTERNAL__IPHONE_6_0
#define __AVAILABILITY_INTERNAL__IPHONE_6_0 __AVAILABILITY_TOO_NEW
#endif
然后重复所有有意义的版本(即Xcode 4.5的4.3及以上版本)。 __ IPHONE_OS_VERSION_MIN_REQUIRED
宏将检查部署目标。
Then repeat for all the versions that make sense (i.e. 4.3 and above for Xcode 4.5). The __IPHONE_OS_VERSION_MIN_REQUIRED
macro will check the deployment target.
这篇关于获取xcode 4.5以警告新的API调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!