- 方法弃用告警
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
//
#pragma clang diagnostic pop
- 不兼容指针类型
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
//
#pragma clang diagnostic pop
- 循环引用
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-retain-cycles"
self.completionBlock = ^ {
...
};
#pragma clang diagnostic pop
- 未使用变量
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-variable"
int a;
#pragma clang diagnostic pop
- 未使用default
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcovered-switch-default"
// switch (style) {
// case UITableViewCellStyleDefault:
// case UITableViewCellStyleValue1:
// case UITableViewCellStyleValue2:
// case UITableViewCellStyleSubtitle:
// // ...
// default:
// return;
// }
#pragma clang diagnostic pop
- -This block declaration is not a prototype
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wstrict-prototypes"
typedef void (^UpdateSwichBtnBlock)();
#pragma clang diagnostic pop
- deprecated 警告消除
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
这里写出现警告的代码
#pragma clang diagnostic pop
- Empty paragraph passed to '@xxx' command
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
//
要去除警告的代码
//
#pragma clang diagnostic pop
- incompatible pointer types assigning to 'MyArrayList*'from 'NSMutableArray'
加入强制转换(MyArrayList*)
- Implicit conversion from enumeration type 'UIInterfaceOrientation' to different enumeration type 'UIDeviceOrientation'
类型不匹配。跳到出错的那一行,UIInterfaceOrientation强制转换为UIDeviceOrientation。