How to suppress the deprecation warning "dispatch_get_current_queue() is deprecated...in iOS 6.0"?
Asked Answered
S

2

14

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.

Stringed answered 28/12, 2012 at 6:56 Comment(0)
R
51

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
Retouch answered 28/12, 2012 at 7:6 Comment(0)
F
0

You can also add -Wno-deprecated-declarations to "Other Warnings Flags" (WARNING_CFLAGS) to ignore all deprecation warnings.

If you have some deprecation warnings in Objective-C code that you plan to replace with Swift anyway, that may make sense. Otherwise, I'd highly encourage you to use @Ilanchezhian's solution to push and pop ignoring each warning.

Fluoresce answered 14/4 at 22:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.