1.方法弃用告警
- #pragma clang diagnostic push
- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
- [TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]];
- #pragma clang diagnostic pop
2.不兼容指针类型
- #pragma clang diagnostic push
- #pragma clang diagnostic ignored "-Wincompatible-pointer-types"
- //
- #pragma clang diagnostic pop
3.retain cycle
- // completionBlock is manually nilled out in AFURLConnectionOperation to break the retain cycle.
- #pragma clang diagnostic push
- #pragma clang diagnostic ignored "-Warc-retain-cycles"
- self.completionBlock = ^ {
- ...
- };
- #pragma clang diagnostic pop
4.未使用变量
- #pragma clang diagnostic push
- #pragma clang diagnostic ignored "-Wunused-variable"
- int a;
- #pragma clang diagnostic pop