Tuesday, August 20, 2013

iOS Tip: Disabling ARC for Specific Classes

Beginning with iOS 5, Apple has provided the Automatic Reference Counting (ARC) feature to free the developers from having to manually manage  the allocation and freeing of objects. However, if you are using some third-party libraries that have yet to support ARC, you can choose to selectively disable ARC for specific classes as ARC is a compiler feature.


To disable ARC for specific classes, select the project name in Xcode and select the Build Phases tab:


Expand the Compile Sources section then select the files representing the classes that you want to disable ARC. Press the Enter key and then enter the following statement in the pop-up window:

-fno-objc-arc


Press Enter and that’s it! The selected files will now compile without ARC. 

No comments: