1

I have imported a lot of files with ARC into non-ARC iOS xCode project. There are also multiple targets in this project. So I need to add -fobjc-arc flags manually for each file in each target (in the opposite case it will be just another flag - -fno-objc-arc).

Could you advice a way how to make this process faster/semi-automatically? For example, is it possible to set flag for multiple files at once or to set flag for one file but for multiple targets?

Vyachaslav Gerchicov
  • 2,317
  • 3
  • 23
  • 49
  • 1
    is there a reason you didn't migrate to arc before importing? – Wain Jun 03 '16 at 10:19
  • This reason is simple - I'm not the owner of this project and so I don't have a permission to do that. And even if I'll do so - the same situation can happen - I'll have ARC project and I'll need to import non-ARC files. – Vyachaslav Gerchicov Jun 03 '16 at 10:38

1 Answers1

0

I found a similar question with answer:

Batch adding "-fno-objc-arc" flag to (multiple) source files

But I want to improve that answer slightly. You should add all the files you need to set flags into one folder with unusual exuding name. For example I used "OOOOOOOOOOOOOOOOOOOOOOOOOOOO". So it will be easier to find all these files in Build Phases tab.

Then as in that answer you can use Shift and/or Command to select these files and press Enter to display the flag editor and add the necessary flags. Then you can rename the folder back with normal name.

Community
  • 1
  • 1
Vyachaslav Gerchicov
  • 2,317
  • 3
  • 23
  • 49