Last active
December 23, 2015 03:59
-
-
Save Kjuly/6576780 to your computer and use it in GitHub Desktop.
Ignore just one deprecated warning. e.g.: calling UIDevice's |-uniqueIdentifier| without warning.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Disable deprecated-declarations warning. | |
See http://clang.llvm.org/docs/UsersManual.html#diagnostics_pragmas | |
Basic workflow: | |
1. push current warnings onto stack | |
2. ignore warning we know will get thrown | |
3. do dodgy thing that causes warning | |
4. pop warnings - go back to what we had before we started fiddling with them | |
OP: http://blog.goosoftware.co.uk/2012/04/18/unique-identifier-no-warnings/ | |
Marked Posts: | |
- http://vgable.com/blog/2009/06/15/ignoring-just-one-deprecated-warning/ | |
- http://stackoverflow.com/questions/6481808/xcode-ios-get-rid-of-deprecation-warnings-for-specific-constants | |
*/ | |
#ifdef TESTING | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Wdeprecated-declarations" | |
[TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]]; | |
#pragma clang diagnostic pop | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment