Skip to content

Instantly share code, notes, and snippets.

@Kjuly
Last active December 23, 2015 03:59
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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.
/*
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