简体   繁体   English

如何从XCode中删除ARC

[英]How to remove ARC from XCode

I have already created a project in XCode 4.2 with ARC checked. 我已经在XCode 4.2中创建了一个项目,并选中了ARC。 The problem is that I have to download and add the ASIHttpRequest files. 问题是我必须下载并添加ASIHttpRequest文件。 This is giving a whole bunch of errors when I try to compile. 当我尝试编译时,这会产生一大堆错误。 Is there some way to fix this (other than to create a project again) ? 有没有办法解决这个问题(除了再次创建一个项目)?

单击左侧导航视图中项目的名称,转到目标 - >构建阶段,并将-fno-objc-arc添加到任何相关文件的“编译器标志”。

You can turn off ARC per-file by passing the flag -fno-objc-arc to each as they are compiled. 您可以通过在编译时将标志-fno-objc-arc传递给每个文件来关闭ARC每个文件。 Add the flag to the files that need ARC disabled in the Compile Sources group under the target in the project navigator. 将标志添加到项目导航器中目标下的Compile Sources组中需要ARC禁用的文件。

Another option would be to compile ASIHttpRequest as its own framework that doesn't have ARC enabled and just link against the framework. 另一种选择是将ASIHttpRequest编译为自己的框架,该框架没有启用ARC,只是链接到框架。 Speak of, isn't ASIHttpRequest already in a framework? 说起来,ASIHttpRequest已经不在框架中吗? (I've not looked at it in a while) (我好一阵子都没看过)

Keep using ARC, but disable it for the ASIHttpRequest files. 继续使用ARC,但为ASIHttpRequest文件禁用它。 This answer should point you in the right direction: 这个答案应该指出你正确的方向:

How can I disable ARC for a single file in a project? 如何为项目中的单个文件禁用ARC?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM