How to enable/disable ARC in an xcode project?

后端 未结 4 720
囚心锁ツ
囚心锁ツ 2020-12-04 11:05

If a project has already been created with ARC disabled, how do I enable it and vice versa?

4条回答
  •  春和景丽
    2020-12-04 11:24

    When you migrate a project to use ARC, the -fobjc-arc compiler flag is set as the default for all Objective-C source files. You can disable ARC for a specific class using the -fno-objc-arc compiler flag for that class. In Xcode, in the target Build Phases tab, open the Compile Sources group to reveal the source file list. Double-click the file for which you want to set the flag, enter -fno-objc-arc in the pop-up panel, then click Done.

提交回复
热议问题