7

Is it possible to combine ARC and non-ARC projects? I haven't really tried it yet but this is the scenario:

We have an old iOS project (non-ARC) with a tab controller. There is a tab from the tab controller that doesn't have any function or view yet. I am making a new project which is related to the old project, and I would like to have it use ARC, if it is possible to combine my new project with the old one and assign my new project's view to the tab.

jscs
  • 63,694
  • 13
  • 151
  • 195
JCurativo
  • 713
  • 6
  • 17
  • 1
    possible duplicate of [Using code that doesn't support ARC, from an ARC project](http://stackoverflow.com/questions/8651365/using-code-that-doesnt-support-arc-from-an-arc-project) – jscs Mar 26 '12 at 02:17
  • 1
    possible duplicate of [How can I disable ARC for a single file in a project?](http://stackoverflow.com/questions/6646052/how-can-i-disable-arc-for-a-single-file-in-a-project) – Lily Ballard Mar 26 '12 at 02:19
  • Thank you Sir Iulius Cæsar and Sir Kevin Ballard! – JCurativo Mar 26 '12 at 02:37

1 Answers1

15

Yes of course and it is very easy. Start your new project with arc and just "tag" the old imported .m files with the not arc thingy. Follow this tutorial to see how:

http://www.raywenderlich.com/5677/beginning-arc-in-ios-5-part-1

(explains about how to convert but also about how to maintain in a non arc fashion)

Edit: The non arc tag is -fno-objc-arc you should set the files that you want xcode to consider non arc like this:

enter image description here

(taken from Ray Wenderlich tutorial page)

Pochi
  • 13,391
  • 3
  • 64
  • 104