1.方法启用警告
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
//code这里插入相关的代码
#pragma clang diagnostic pop
2.不兼容指针类型
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
//code这里插入相关的代码
#pragma clang diagnostic pop
3.retain cycle
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-retain-cycles"
//code这里插入相关的代码
#pragma clang diagnostic pop
4.未使用变量
#pragma clang diagnostic push
#pragma clang diagnostic ignored "--Wunused-variable"
//code这里插入相关的代码
#pragma clang diagnostic pop
5. selector中使用了不存在的方法名(在使用反射机制通过类名创建类对象的时候会需要的)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
//code这里插入相关的代码
#pragma clang diagnostic pop