Treat Warnings as Errors

March 19, 2012

It’s good to keep things clean from the start, whether you are running a simple test, writing a large scale enterprise app or building anything in between. With that in mind, I highly recommend you always configure project settings so the compiler treats warnings as errors – in other words, a warning will result in the same output as an error, no executable created.

To configure Xcode to treat warnings as errors, head over to the Build Settings:

• In the search box look for “warnings”
• Scroll to find the entry “Treat Warnings as Errors”
• Set the value to Yes

Remember, warnings are there for a reason, pointing out potential issues with your code. Why would you choose to ignore them?