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

前端 未结 18 2885
星月不相逢
星月不相逢 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:21

    I think all the other answers are explaining how to disable MRC(Manual Reference Count) and enabling ARC(Automatic Reference Count). To Use MRC(Manual Reference Count) i.e. Disabling ARC(Automatic Reference Count) on MULTIPLE files:

    1. Select desired files at Target/Build Phases/Compile Sources in Xcode
    2. PRESS ENTER
    3. Type -fobjc-arc
    4. Press Enter or Done

提交回复
热议问题