0

I converted a non-ARC code to an ARC code. I added -fno-objc-arc in compiler flags to certain files that did not require ARC.

However, I am still receiving 50 errors INSIDE those files which are ARC errors. What to do?

Cyrille
  • 25,014
  • 12
  • 67
  • 90
ScarletWitch
  • 522
  • 6
  • 23
  • try to clean the project (Cmd+Shift+K), and tell us what errors do you get – Gabriele Petronella Jun 27 '13 at 13:45
  • Maybe you have some references inside those files to objects that have ARC activated? – Totumus Maximus Jun 27 '13 at 13:49
  • We'll need to know more. What errors? What files? Are this standard files? – Abizern Jun 27 '13 at 14:01
  • possible duplicate of [-fno-objc-arc not working to disable ARC](http://stackoverflow.com/questions/10819108/fno-objc-arc-not-working-to-disable-arc) – lnafziger Jun 27 '13 at 14:18
  • [This question](http://stackoverflow.com/questions/10819108/fno-objc-arc-not-working-to-disable-arc) might help you. Often times there is a dependency chain of files (through your `#import` statements) which causes problems in other files than the ones appearing in the error list. Trying adding -fno-objc-arc to some files that import the ones giving you errors. – eric.mitchell Jun 27 '13 at 13:51
  • I have added -fno-objc-arc on all files except the ones that have ARC. Still not working. And the errors received are like - Retain not allowed in ARC.... Release not allowed in ARC. though i have added -fno-objc-arc to all these files. – ScarletWitch Jun 27 '13 at 14:26
  • do you get that after cleaning the project, and project derived data? – Nitin Alabur Jun 27 '13 at 15:48
  • yes... After cleaning it like 4-5 times and then running it gives errors. – ScarletWitch Jun 28 '13 at 07:52

1 Answers1

2

I did it... I did it by adding

-fobjc-arc

to all the Compiler flags of files that require ARC. And adding

-fno-objc-arc

to Compiler flags of files that dont require ARC. And switching on the ARC for the project overall. It works for me.

ScarletWitch
  • 522
  • 6
  • 23