Conditional compilation when using ARC

前端 未结 1 958
借酒劲吻你
借酒劲吻你 2021-01-12 13:21

Is there a way to ask the compiler if ARC is turned on, and then conditionally compile based upon that value? For example, I have a protocol:

@protocol Proto         


        
相关标签:
1条回答
  • 2021-01-12 13:39

    You should do #if __has_feature(objc_arc) That will expand to 1 in the case of ARC being enabled.

    This is from the ARC docs from Clang.

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