How can I disable ARC for a single file in a project?

前端 未结 18 2960
星月不相逢
星月不相逢 2020-11-21 04:31

I am using ARC successfully in my project. However, I have encountered a few files (e.g., in unit tests and mock objects) where the rules of ARC are a little more fragile ri

18条回答
  •  自闭症患者
    2020-11-21 05:08

    It is possible to disable ARC (Automatic Reference Counting) for particular file in Xcode.

    Select Target -> Build Phases -> Compile Sources -> Select File (double click) -> Add "-fno-objc-arc" to pop-up window.

    I had encountered this situation in using "Reachibility" files.

    This is shown in below figure :

    enter image description here

提交回复
热议问题