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

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

    It is very simple way to make individual file non-arc.

    Follow below steps :

    Disable ARC on individual file:

    1. Select desired files at Target/Build Phases/Compile Sources in Xcode

    2. Select .m file which you want make it NON-ARC PRESS ENTER Type -fno-objc-arc

    Non ARC file to ARC project flag : -fno-objc-arc

    ARC file to non ARC project flag : -fobjc-arc

提交回复
热议问题