Automatic Reference Counting and Frameworks

October 12th, 2011 by Ricardo Silva Leave a reply »

ARC is a compile-time technology, which actually results in a notable performance benefit. The compiler generates calls to retain/release/autorelease on your behalf, instead of you inserting them manually. Nothing new happens at run-time, which is why ARC can be enabled/disabled on a file-by-file basis when compiling an Xcode project.

If you need to use other third party frameworks that are not available as static libraries and don’t support ARC in projects supporting ARC, you can specify compile flags per files.

With Xcode 4.2, you can use -fno-objc-arc only for the framework, like JSONKit, for example.

Steps:

  1. Select project;
  2. Select target;
  3. Open “Build Phases” tab;
  4. Open “Compile Sources (nn items)”;
  5. On second column, you can specify “Compiler Flags”. Set to -fno-objc-arc for each file you want.
Advertisement

Leave a Reply