Get xcode 4.5 to warn about new API calls

后端 未结 2 1731
长情又很酷
长情又很酷 2020-12-05 06:11

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 avail

相关标签:
2条回答
  • 2020-12-05 06:53

    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
    

    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.

    0 讨论(0)
  • 2020-12-05 06:53

    This tool can do the job of finding too new API calls in your project: http://www.deploymateapp.com/

    0 讨论(0)
提交回复
热议问题