iOS5 – how to turn off ARC on individual files ?

Turn Off ARC

iOS5 SDK comes with new feature of ARC.

ARC = Automatic Reference Counting which is used for enabling memory management at compiler level.

ARC - Automatic Reference Counting

But due to this feature, you might not able to compile facebook API, HJCache library or any other libraries developed for iPhone/iPad development.

Here is the one of the example of that error.

Automatic Reference Counting forbids explicit message send of ‘dealloc’

I have shared a trick to enable older library compilation in new iOS5 SDK.

  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 )

One thought on “iOS5 – how to turn off ARC on individual files ?

Leave a message