Skip to content

Instantly share code, notes, and snippets.

@simonwhitaker
Created April 18, 2012 14:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save simonwhitaker/2413961 to your computer and use it in GitHub Desktop.
Save simonwhitaker/2413961 to your computer and use it in GitHub Desktop.
Suppress deprecated-declarations warning when calling uniqueIndentifier, e.g. for TestFlight API
#ifdef TESTING
/*
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
*/
#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