Created
April 18, 2012 14:30
-
-
Save simonwhitaker/2413961 to your computer and use it in GitHub Desktop.
Suppress deprecated-declarations warning when calling uniqueIndentifier, e.g. for TestFlight API
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
#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