Donald Burr
Donald Burr

Reputation: 2281

(XCode) Turning off warnings when compiling certain files?

I use several third-party libraries in my iOS project that generate some warnings. Is there a way I can turn off warnings on those specific files only, similar to the way you can turn off ARC on a per-file basis by adding the "-fno-objc-arc" flag to the "compile sources" area in build phases?

Upvotes: 4

Views: 685

Answers (1)

pepsi
pepsi

Reputation: 6865

In Xcode, there's an option to set per-file compiler flags:

  • In the Project Navigator pane, click on your project
  • Select the target you're building with
  • Choose the Build Phases tab
  • Scroll down and expand the Compile Sources phase
  • Locate the "Compiler Flags" column
  • Set the compiler flag to -w for the file you want to suppress warnings for

Upvotes: 2

Related Questions