简体   繁体   中英

How to remove ARC from XCode

I have already created a project in XCode 4.2 with ARC checked. The problem is that I have to download and add the ASIHttpRequest files. 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. Add the flag to the files that need ARC disabled in the Compile Sources group under the target in the project navigator.

Another option would be to compile ASIHttpRequest as its own framework that doesn't have ARC enabled and just link against the framework. Speak of, isn't ASIHttpRequest already in a framework? (I've not looked at it in a while)

Keep using ARC, but disable it for the ASIHttpRequest files. This answer should point you in the right direction:

How can I disable ARC for a single file in a project?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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