0
votes

I just re added all my files to the project and there are about 150 files that need to use -fno-objc-arc because of release. Is there any quick way to add -fno-objc-arc flag to all files that use arc without adding this flag manually to all 150 files.

1

1 Answers

2
votes

Easy. On the Build Phases tab of your target, select all 150 files in the Compile Sources section. Then double-click in the Compiler Flags column of one of the selected files. Enter -fno-objc-arc into the little popup window then press Enter.

The flag will be added to all of the selected files.

A better solution would be to refactor the old MRC code into ARC code. Simply delete all calls to release, retain, and autorelease. Remove the call to [super dealloc] in your dealloc method. If dealloc is now empty, remove the whole method.