MENU

Including Code that is not ARC Compliant

Including Code that is not ARC Compliant

According to Apple’s documentation: “ARC interoperates with manual reference counting code on a per-file basis. If you want to continue using manual reference counting for some files, you can do so.”

This means some files can use ARC and some files can be spared from it’s magical grasp. Here are the steps for bulk excluding files from ARC at compile time. At the time of writing, many popular libraries are not ARC ready, to get around this follow these steps:

  • Click on your Project in the Xcode project tree
  • Click on the Target
  • Select the Build Phases tab
  • Expand the Compile Sources section
  • Select one or more files you want to exclude from ARC
  • Press the return key
  • Type -fno-objc-arc
  • Press the return key again
  • Each file selected now has a -fno-objc-arc compiler flag set and will be excluded from ARC

Leave a Comment!

Your email address will not be published. Required fields are marked *