如何取消弃用警告“ iOS 6.0中已弃用……dispatch_get_current_queue()”? [英] How to suppress the deprecation warning "dispatch_get_current_queue() is deprecated...in iOS 6.0"?

查看:144
本文介绍了如何取消弃用警告“ iOS 6.0中已弃用……dispatch_get_current_queue()”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



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

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

解决方案

您可以使用下面的代码来禁止显示警告。

  #pragma clang诊断推
#pragma clang诊断被忽略 -Wdeprecated-declarations

dispatch_get_current_queue()//您不推荐使用的调用代码

#pragma clang诊断弹出


So the question is the subject question - I want to get rid of this warning which is pretty annoying.

Is there a way to make it silent?

Note: I use dispatch_get_current_queue() for debugging purposes only.

解决方案

You could use the following code to suppress the warnings.

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

dispatch_get_current_queue() // your deprecated calling code

#pragma clang diagnostic pop

这篇关于如何取消弃用警告“ iOS 6.0中已弃用……dispatch_get_current_queue()”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆