Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios5 ARC what is the compiler flag to exclude a file from ARC?

Can anyone help me remember what was the flag to tell the XCode to not use ARC for some file? I had several files in my project marked as such... Until I added another file and decided to convert that one to ARC. Sounds easy, right? I expected that I would be able to simply check a file that I want and let the XCode do it's magic. Well, not so easy, during pre-check it stripped all -Noarc flags from the files and now I need to manually re- apply the flag to several files.

the moral of this story is: once your project is in ARC and you have some files marked as no ARC, do not re-run the convert to ARC tool from Refactor>Convert to ARC. It will not restore your settings even if pre-check fails.

like image 591
Alex Stone Avatar asked Nov 07 '11 18:11

Alex Stone


2 Answers

I found the answer: to exclude the file from ARC, use the -fno-objc-arc flag in build phases>compile sources

like image 172
Alex Stone Avatar answered Sep 20 '22 21:09

Alex Stone


the moral of this story is: once your project is in ARC and you have some files marked as no ARC, do not re-run the convert to ARC tool from Refactor>Convert to ARC. It will not restore your settings even if pre-check fails.

You can restore your settings for excluded files by removing references on them and then readd to project back

like image 30
alokard Avatar answered Sep 22 '22 21:09

alokard