iOS5 – how to turn off ARC on individual files ?


iOS5 SDK comes with new feature of ARC.

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

fig.1

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 )
I hope this might be helpful to you.
Please let me know your comments for this.
Thanks & Regards,
Ankit Vyas
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s