Disabling ARC in Xcode

Posted by

ARC

Automatic Reference Counting (ARC) is a compiler feature that provides automatic memory management of Objective-C objects. Rather than having to think about retain and release operations, ARC allows you to concentrate on the interesting code, the object graphs, and the relationships between objects in your application.

https://developer.apple.com/library/ios/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html

Issue

When you want to use objects whose life time is not set and are not willing to use ARC. then you’ll end up with an issue raised by Xcode IDE;

arc_error1

Solution

arc_error2

1. Double click on your project,

2. Click on “Build Phases” at the top menu,

3. Expand “Compile Sources”,

4. Double click on the file(s) that you want to disable ARC and add the below flags and close

-fno-objc-arc

you’ll notice the issue is gone once you close the pop up screens¬†in order for saving the changes.

arc_error3

Leave a Reply

Your email address will not be published. Required fields are marked *