Suppressing deprecated warnings in Xcode

Since I yet can not add a comment to the @samiq post, I think I will expand it. Input mentioned directive before a function / method in which you use deprecated stuff. Then you can restore the previous setting after the definition of the function end:

#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- (void) methodUsingDeprecatedStuff {
    //use deprecated stuff
}
#pragma GCC diagnostic warning "-Wdeprecated-declarations"
 

相关推荐