如何强制 xcode 在特定文件上使用 ARC?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13392521/
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 02:06:05  来源:igfitidea点击:

How to force xcode to use ARC on a specific file?

xcodebuildxmppautomatic-ref-countingcompiler-flags

提问by Maduranga E

My project contains XMPPFramework which contains a file that has to be used with ARC. But my project is Non ARC and cannot be converted due to certain other libraries linked to it.

我的项目包含 XMPPFramework,其中包含必须与 ARC 一起使用的文件。但我的项目是非 ARC,由于链接到它的某些其他库而无法转换。

How do I force the compiler to use ARC only on a certain class ?

如何强制编译器仅在某个类上使用 ARC?

回答by justin

It is the inverse problem of this question. The difference is that you would use -fobjc-arcinstead of -fno-objc-arc.

本题的逆。不同之处在于您将使用-fobjc-arc而不是-fno-objc-arc.