Disabling ARC for Specific Files
May 2, 2012, 10:01 a.m.

ARC is a wonderful feature of the iOS 5 SDK that saves developers from a lot of headaches. Sometimes, however, you need to add files to your project that do not rely on ARC.

Using retain and release in ARC is forbidden and the compiler will not allow any manual memory management. This means that when you add classes to your project that do manual memory management, you will get compiler errors.

To fix the errors you need to tell the compiler to treat the files as normal manually memory managed files. This is done by setting a compiler-flag for each file under Target > Build Phases > Compile Sources. The flag to use is:

-fno-objc-arc
Comments