Automatic Reference Counting (ARC) in Xcode 4.2

ARC = Automatic Reference Counting is a new feature that come with Xcode 4.2. From the Apple iOS 5 developer page wrote “Automatic Reference Couning (ARC) for Objective-C makes memory management the job of the compiler. By enabling ARC with the new Apple LLVM compiler, you will never need to type retain or release again, dramatically simplifying the development process, while reducing crashes and memory leaks. The compiler has a complete understanding of your objects, and releases each object the instant it is no longer used, so apps run as fast as ever, with predictable, smooth performance.“.

So that mean you don’t have to release object anymore. But the problem is “If I want to manage the memory by myself. What should I do?” Let’s follow this.

1. Click on the Project.
2. Click on the target.
3. Select build phases tab.
4. Select the multiple files in which you want to turn off ARC
5. Press ENTER / Hit Enter key
6. Type “-fno-objc-arc” ( without quotes, as shown in image ).

Or see this video.

Hope this article be useful to you.

credits:
http://sugartin.info/2011/08/10/ios5-how-to-turn-off-arc-on-individual-files/
http://developer.apple.com/technologies/ios5/