iOS - Disable ARC on XCode Projects

Is there a way to disable Automatic Reference Counting (arc) when Unity builds the XCode project? When I open the XCode project, I see that Objective-C Automatic Reference Counting is set to “Yes” in Build Settings. But having this on is breaking a plugin that I have. I want to know how to change this when it builds the project so I don’t have to remember to switch it every time I make a new build.

I’m using Unity 5 Beta v18 on a Mac. Trying to build with default iOS Settings.

Thanks in advance for any help.

I figured it out! For others out there that might run into this issue, here’s how to fix it.

I didn’t realize Unity allowed you to add custom Compile flags to individual plugins. Simply find your plugin code in the Assets/Plugins/iOS/ folder, select the file that’s giving you problems. In the Inspector you should see “Compile flags” towards the bottom. Add -fno-objc-arc to this and hit “Apply.” Now Unity will compile the XCode project with ARC turned off for this file. Pretty neat!

If you have 4.6.x you can do it via a Post Process build script. See this as an example: