- 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
更多内容,请查阅
http://clang.llvm.org/docs/UsersManual.html#diagnostics_pragmas
http://nshipster.com/pragma/
http://www.cocoachina.com/applenews/devnews/2013/0731/6707.html
文章来自:www.cnblogs.com/goodboy-heyang/p/5097595.html
网友评论