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

时间:2012-12-28 06:56:11

标签: objective-c ios deprecated

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

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

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

1 个答案:

答案 0 :(得分:30)

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

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

dispatch_get_current_queue() // your deprecated calling code

#pragma clang diagnostic pop
相关问题