今天在处理项目中相关警告的时候发现了很多问题,包括各种第三方库中的警告,以及各种乱七八糟的问题  先说说标题中的问题  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 中 就可以处理大部分的警告了

ios警告:Category is implementing a method which will also be implemented by its primary class 引发的相关处理的更多相关文章

  1. IOS 警告 收集

    Semantic Warnings Warning Message -WCFString-literal input conversion stopped due to an input byte t ...

  2. iOS警告收录及科学快速的消除方法

    来自: http://www.cnblogs.com/dsxniubility/p/4757760.html iOS警告收录及科学快速的消除方法     前言:现在你维护的项目有多少警告?看着几百条警 ...

  3. iOS类别(Category)

    iOS类别(Category)与扩展(Extension) 苹果的官方文档 Category在iOS开发中使用非常频繁.尤其是在为系统类进行拓展的时候,我们可以不用继承系统类,直接给系统类添加方法,最 ...

  4. idea @Override is not allowed when implementing interface method

    转自:http://blog.csdn.net/shenya2/article/details/50460447 在编码过程发现报错:@Override is not allowed when imp ...

  5. Override is not allowed when implementing interface method Bytecode Version Overriding and Hiding Methods

    java - @Override is not allowed when implementing interface method - Stack Overflow https://stackove ...

  6. IDEA @Override is not allowed when implementing interface method(转载)

    近期研究idea,在编码过程发现报错:@Override is not allowed when implementing interface method .找到一个老外的回答,感觉挺有用的,记录下 ...

  7. iOS 警告收集快速消除

    1.ld: warning: directory not found for option 去掉警告的方法 工程老是提示ld: warning: directory not found for opt ...

  8. iOS分类(category),类扩展(extension)—史上最全攻略

    背景: 在大型项目,企业级开发中多人同时维护同一个类,此时程序员A因为某项需求只想给当前类currentClass添加一个方法newMethod,那该怎么办呢? 最简单粗暴的方式是把newMethod ...

  9. iOS 警告收录及科学快速的消除方法

    http://www.cocoachina.com/ios/20150914/13287.html 作者:董铂然 授权本站转载. 前言:现在你维护的项目有多少警告?看着几百条警告觉得心里烦么?你真的觉 ...

随机推荐

  1. cdoj 26 遮挡判断(shadow) 水题

    遮挡判断(shadow) Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/problem/show/26 ...

  2. Android Checkbox Example

    1. Custom String 打开 “res/values/strings.xml” 文件, File : res/values/strings.xml <?xml version=&quo ...

  3. [AngularJS] TweenList 3D + AngularJS Animate

    AngularJS animations and TweenLite make it really easy to create cool 3d effects in your application ...

  4. IOS网络编程——第三方类库

    IOS网络编程——第三方类库 目录 概述 ASIHttpRequest AFNetworking 其他 概述 ASIHttpRequest AFNetworking 其他

  5. 主流手持设备GPU性能比较

    设备 GPU CPU 每秒像素填充率 每秒三角形生成 内存 iPhone4 PowerVR SGX 535 ARM Cortex-A8 800M     512M iPod touch 4 Power ...

  6. Linux下校验下载文件的完整性(MD5,SHA1,PGP)

    查看: Linux下校验下载文件的完整性(MD5,SHA1,PGP) http://blog.useasp.net/archive/2014/03/29/use-md5-sha1-or-pgp-to- ...

  7. postgres函数

    1.数据修复最先考虑通过db内做修复,实在不行,在考虑外部应用程序通过jdbc修复. 比如一个场景:profile_image_url与enlarge_image_url都是微博用户信息返回的字段. ...

  8. Android(java)学习笔记263:Android下的属性动画(Property Animation)

    1. 属性动画(Property Animation)引入: 在手机上去实现一些动画效果算是件比较炫酷的事情,因此Android系统在一开始的时候就给我们提供了两种实现动画效果的方式,逐帧动画(fra ...

  9. Java基础知识强化之IO流笔记72:NIO之 NIO核心组件(NIO使用代码示例)

    1.Java NIO 由以下几个核心部分组成: Channels(通道) Buffers(缓冲区) Selectors(选择器) 虽然Java NIO 中除此之外还有很多类和组件,Channel,Bu ...

  10. Bash中的位置参数和特殊参数

    #Bash中的位置参数和特殊参数 #Bash中的位置参数是由0以外的一个或多个数字表示的参数.#位置参数是当Shell或Shell函数被引用时由Shell或Shell函数的参数赋值,并且可以使用Bas ...