禁止警告:xx中类别中的元方法xx与另一类别中的相同方法冲突 [英] Suppress warning: Meta method xx in category from xx conflicts with same method from another category

查看:63
本文介绍了禁止警告:xx中类别中的元方法xx与另一类别中的相同方法冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何抑制此编译器警告: Meta method 'prefix' in category from '...soap+prefix.o' conflicts with same method from another category? 这是类别soap + Prefix.h:

How can I suppress this compiler warning: Meta method 'prefix' in category from '...soap+prefix.o' conflicts with same method from another category ? here is the category soap+Prefix.h:

  @interface Soap (Prefix)

   +(NSString*)prefix;

   @end

和soap + prefix.m:

and soap+prefix.m:

#import "Soap.h"
#import "Soap+Prefix.h"

 @implementation Soap (Prefix)

  +(NSString*)prefix { return @"EInspector"; }

  @end

和这两个文件是使用SudZc包装器自动为Web服务生成的.

and these two files by the way are automatically generated with SudZc wrapper for web services.

p.s.此警告仅在XCode 4.4中发布

p.s. this warning is issued ONLY in XCode 4.4

非常感谢您.

推荐答案

在项目中的其他地方,+[Soap prefix]被声明为一个类别.尝试在项目中搜索+prefix的其他声明.

Somewhere else in your project, +[Soap prefix] is being declared in a category. Try searching your project for other declarations of +prefix.

另一种可能性是,在project.pbxproj文件的大型重构或复杂合并期间,项目最终会得到同一文件的两个引用或副本,并且两者都在被编译.我已经看到了这种情况的发生,而这些警告或错误通常就是这种情况.尝试在Finder中搜索具有相同名称的其他文件,以查看某处是否存在重复文件.

Another possibility is that during a large refactoring or complex merge of your project.pbxproj file, the project ended up with two references or copies of the same file, and both are being compiled. I've seen it happen, and these sorts of warnings or errors are usually what happens. Try searching in the Finder for other files with the same name to see if you have a duplicate file somewhere.

这篇关于禁止警告:xx中类别中的元方法xx与另一类别中的相同方法冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆