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

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

    Note: if you want to disable ARC for many files, you have to:

    1. open "Build phases" -> "Compile sources"
    2. select files with "left_mouse" + "cmd" (for separated files) or + "shift" (for grouped files - select first and last)
    3. press "enter"
    4. paste -fno-objc-arc
    5. press "enter" again
    6. profit!

提交回复
热议问题