xcode 如何为非 ARC 项目中的文件启用 ARC?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11255177/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 00:44:04  来源:igfitidea点击:

How to enable ARC for a file in Non-ARC project?

iphonexcodeautomatic-ref-counting

提问by fannheyward

I know you can use -fno-objc-arcflag to disable ARC for files that NOT support ARC in an ARC project.

我知道您可以使用-fno-objc-arc标志为 ARC 项目中不支持 ARC 的文件禁用 ARC。

Is there any way to enable ARC for files support ARC in a Non-ARC project?

有什么方法可以为非 ARC 项目中支持 ARC 的文件启用 ARC?

Thanks!

谢谢!

回答by Noah Witherspoon

Yup: add the -fobjc-arcflag the same way.

是的:-fobjc-arc以相同的方式添加标志。