Camsoft
Camsoft

Reputation: 11995

How can I disable ARC for an entire group/folder of files?

I'm aware that you can set the compiler flag -fno-objc-arc to disable Automatic Reference Counting (ARC) for each file in Compile Sources in XCODE but how can I do this for an entire group of files without having to do each file at a time?

The reason I ask is that I've added a large library to my application and I need to set the -fno-objc-arc compiler flag for over 100 files.

Upvotes: 21

Views: 5491

Answers (2)

Krrish
Krrish

Reputation: 2256

Goto Build Phases -> Compile sources select multiple files holding command ⌘ and press enter then add the value -fno-objc-arc It will reflect for all the selected files.

Upvotes: 43

Sergey Kalinichenko
Sergey Kalinichenko

Reputation: 726479

I do not think that XCode lets you set this flag for a folder or a group, but you have two reasonable alternatives to setting the flag on individual files:

  1. If your library is self-contained, you can create a separate project for it in the same workspace as your application, and disable ARC for that project.
  2. If you are OK modifying the source of that library, you can attempt an automated ARC conversion.

Upvotes: 1

Related Questions