Disable ARC for a single file in a project

来源:互联网 发布:学生网络选修课网址 编辑:程序博客网 时间:2024/05/16 14:13

在iOS工程中利用ARC来管理内存已经很常见了,但有些比较老的项目不支持ARC的时候必须手动对这些文件进行修改:

It is possible to disable ARC for individual files by adding the

1
-fno-objc-arc

compiler flag for those files.

You add compiler flags in Targets -> Build Phases -> Compile Sources. You have to double click on the right column of the row under Compiler Flags. You can also add it to multiple files by holding the cmd button to select the files and then pressing enter to bring up the flag edit box.



原创粉丝点击