Cosmin
Cosmin

Reputation: 7081

How to Hide Warnings in Xcode

Yes I know that warnings are useful and should not be disabled and I usually correct all of them, but in XCode they mingle with my code and get on my nerves. I want to see warnings when I need them not all the time and in my face!

I'm ticked by the warnings displayed for Swift since they change the language constructs all the time! They have now obsoleted the for loop (I have never heard of a language that changes it's most basic constructs, but I suppose Apple could get away with anything) and now I get warnings embedded in my code every were.

It will be much better if the warnings would not expand in my code when I do a compile so I can expand them manually if I need them. Is this possible without disabling them in settings?

Upvotes: 46

Views: 39337

Answers (5)

AYO
AYO

Reputation: 1

For me, setting "Inhibit All Warning Flags" to "Yes" in Apple Clang - Warning Policies under the Build Settings tab (With All and Levels options highlighted) eliminated all warnings: "/* within block comment."

This is the image of the warnings on my XCode before the Inhibit All Warning Flags is set to "Yes"

(XCode Version 10.10 (10A255)).

Upvotes: 0

Santosh Gogi
Santosh Gogi

Reputation: 51

In Xcode 8, you can hide the warning's messages in the editor by

Editor - Issues - (Select) Errors only or completely show/hide errors and warnings using "Hide All Issues" or use shortcut Ctrl + Cmd + M

e

Upvotes: 5

Mahendra Vishwakarma
Mahendra Vishwakarma

Reputation: 494

Select your project and select your target and show Build Phases. Search the name of the file in which you want to hide, and you should see it listed in the Compile Sources phase. Double-click in the Compiler Flags column for that file and enter -w to turn off all warnings for that file. Hope it will help you.

Upvotes: 9

Hernani Fernandes
Hernani Fernandes

Reputation: 1046

I don't know if there are this option on Xcode 7, but in Xcode 8 just click at this icon on bottom at left side (blue icon) and it will filter only errors:

enter image description here

Upvotes: 102

Ramesh_T
Ramesh_T

Reputation: 1261

First of all, it's a really bad idea: warnings exist for a reason, you really should check each of them.

There are few ways to try.

  1. Select Target -> select Build settings search as Warnings

Here you can change the Selected warnings to NO by selecting the dropdown.

enter image description here

  1. If you want to hide Objective c warnings follow the second image.

enter image description here

  1. If you want to hide Storyboard and XIBs warnings see the below image.

enter image description here

  1. If you want to hide Assets warning see the below image.

enter image description here

I hope this may help you :)

Upvotes: 21

Related Questions