如何抑制弃用警告"在iOS 6.0中不推荐使用dispatch_get_current_queue()"?

Sta*_*ich 10 objective-c deprecated ios

所以问题是主题问题 - 我想摆脱这个非常烦人的警告.

有没有办法让它保持沉默?

注意:我使用dispatch_get_current_queue()仅用于调试目的.

Ila*_*ian 32

您可以使用以下代码来禁止警告.

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

dispatch_get_current_queue() // your deprecated calling code

#pragma clang diagnostic pop
Run Code Online (Sandbox Code Playgroud)