How to enable/ disable “Automatic Reference Counting”?

拈花ヽ惹草 提交于 2019-11-29 01:00:07

Globally:

Go to "Build Settings", look for "Apple LLVM compiler 3.0 - Language". Set the field "Objective-C Automatic Reference Counting" to "No".

For individual files:

Go to "Build Phases", select the file, double-click the "Compiler Flags" column and put "-fno-objc-arc" in it.

To enable ARC per-file, you can also set your "Compiler Flags" under "Build Phases" to -fobjc-arc. Make sure your compiler is set to Apple LLVM compiler 4.x and not LLVM GCC 4.2.

In XCode 4.6 this property has now changed to CLANG_ENABLE_OBJC_ARC

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!