今天在处理项目中相关警告的时候发现了很多问题,包括各种第三方库中的警告,以及各种乱七八糟的问题  先说说标题中的问题  Category is implementing a method which will also be implemented by its primary class  这个警告的意思是 我在category中重写了原类的方法 而苹果的官方文档中明确表示  我们不应该在category中复写原类的方法,如果要重写 请使用继承  原文是这样的:A category allows you to add new methods to an existing class. If you want to reimplement a method that already exists in the class, you typically create a subclass instead of a category.  所以这里就出现了警告,警告而已,毕竟不是错误,所以也不会影响我们的使用,但是会让人看着很不爽,所以查了一下不显示这个警告的方法

1.在相关位置插入下面这段代码

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation" // your override #pragma clang diagnostic pop

2.在target的 build settings下  搜索other warning flags  然后给其添加 -Wno-objc-protocol-method-implementation

好了  警告没有了

这里顺便说一下  2中的方法  对很多批量的警告很有用  而后面相关字段 -Wno-objc-protocol-method-implementation  其实是可以查得到的    方法是在xcode中选择你想屏蔽的警告,右键选择 reveal in log 就可以在警告详情中发现 -Wobjc-protocol-method-implementation  这么一个格式的字段 在-W后添加一个no-  然后在用2中的方法添加到 other warning flags 中 就可以处理大部分的警告了

最新文章

  1. require 那点事
  2. 知方可补不足~UPDLOCK更新锁的使用
  3. 通过get方式传递参数
  4. SDUT 2409:The Best Seat in ACM Contest
  5. 安全增强 Linux (SELinux) 剖析
  6. [转]Linux关机命令详解
  7. 【转】android onNewIntent()触发机制及注意事项
  8. YII开发技巧分享——模型(models)中rules自定义验证规则
  9. leetcode面试准备:Contains Duplicate I && II
  10. 我的ubuntu配置
  11. 实例:用jQuery实现垂直和水平下拉 菜单
  12. HDU 4638 Group 【树状数组,分块乱搞(莫队算法?)】
  13. codevs 3094 寻找sb4
  14. 使用公用表表达式(CTE)
  15. EditPlus 快速去重
  16. Arduino周边模块:LCD与数码管
  17. NodeJs md5 sha1加密
  18. Windwos下 php mysql apache 环境配置
  19. VPS搭建离线下载服务器——后网盘时代
  20. java数据结构与算法(一)

热门文章

  1. 无线网卡的查看与配置——iw,iwconfig,ethtool
  2. Linux内核--usb子系统的分析
  3. Fitness training
  4. ECLIPSE android 布局页面文件出错故障排除Exception raised during rendering: java.lang.System.arraycopy([CI[CII)V
  5. Windows平台下libevent库的使用
  6. [Ramda] Filter, Reject and Partition
  7. iOS开发——实用OC篇&多种定时器详细介绍
  8. chrpath工具使用
  9. Qt 静态编译的问题.
  10. web开发下的各种下载方法