0

I'm working on an app with some old pre-ARC libraries (cocos2d 2.x), and I'm attempting to refactor my project for ARC. I've gone through and tagged all the pre-ARC files -fno-objc-arc in the build phases. However when I refactor for ARC it's still finding issues in these files. It finds 21 issues with CCActionManager.m and then quits. I've tried removing CCActionManager.m and then it just moves onto the next Cocos2d file that has issues. I've removed and re-added the -fno-objc-arc tag to the files, to no avail.

I've done this before with a different app and it worked no problem. I've googled and googled and I can't seem to find anyone else who has had this issue. I've cleaned the project, reverted back to the last commit and tried again, everything I can think of, it refuses to honor the -fno-objc-arc and continues to find issues with these files! What could I be doing wrong?

James
  • 736
  • 1
  • 5
  • 19
  • I don't think refactoring cares or checks for (per-file) compiler flags. It does however differentiate targets. Following the best practice to put code like cocos2d in a separate static library target ought to fix this issue. – CodeSmile Sep 27 '13 at 19:57
  • This used to work though - http://stackoverflow.com/questions/6646052/how-can-i-disable-arc-for-a-single-file-in-a-project – James Sep 30 '13 at 03:29
  • Refactor to ARC ignores that flag, possibly because it has to. You're asking Xcode you want all your code in a specific target to be converted to ARC, therefore it tries to compile all code in your target with ARC enabled first to see what kind of issues come up. Xcode can not really know whether no-ARC flagged files are those you don't want converted or whether you finally want those converted as well. – CodeSmile Sep 30 '13 at 08:17
  • Ah well. I figured if I was gonna do that might as well upgrade to Kobold2D instead. So that's what I did and it runs great now :-) – James Oct 02 '13 at 02:48

0 Answers0