标签:
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://www.cnblogs.com/goodboy-heyang/p/5097595.html