Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove ARC from XCode

Tags:

xcode

ios

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) ?

like image 577
Ashish Agarwal Avatar asked Jan 22 '12 03:01

Ashish Agarwal


2 Answers

Click on the name of the project on the navigation view in the left side, go to Targets -> Build Phases and add -fno-objc-arc to the "compiler flags" for any relevant files.

like image 88
Roy Avatar answered Oct 12 '22 23:10

Roy


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)

like image 23
MyztikJenz Avatar answered Oct 12 '22 22:10

MyztikJenz