views:

685

answers:

2

With all the SDKs floating around, it's handy to be able to build for multiple SDKs and platforms. However, bouncing from 3.2 to 3.0 and even occasionally 2.x, I frequently get deprecated warnings involving methods that have changed or been superseded:

warning: 'UIKeyboardBoundsUserInfoKey' is deprecated.

Since I still want to maintain compatibility with older OSes, and I'm also striving to remove 'noise' when building, is there a way to turn off or disable these warnings?

+3  A: 

Try -Wno-deprecated.

Paul R
Turns out it's even easier than that; there's a checkbox in the Xcode target settings; your answer prompted me to search there. Thanks!
Ben Gottlieb
A: 

You can also suppress warnings per file by using

#pragma GCC diagnostic ignored "-Wdeprecated-declarations"

which in turn makes it a little bit better practice than just suppressing all warning once and together... after all you got to know what you are doing it for.

samiq

related questions