类别冲突:类别中的实例方法与另一个类别中的相同方法发生冲突 [英] Category Conflict: instance method in category from conflicts with same method from another category

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

问题描述

我知道有两种情况会导致以下错误:

There are two situations, that I am aware of, that cause the following errors:

ld: warning: instance method 'resetAudioSystem' in category from /opentok-ios-sdk/Opentok.framework/Opentok(OTPublisher+AudioSnoop.o) conflicts with same method from another category
ld: warning: instance method 'attachAudioSnoopBlock:' in category from /opentok-ios-sdk/Opentok.framework/Opentok(OTPublisher+AudioSnoop.o) conflicts with same method from another category
ld: warning: instance method 'setVideoSnoopDelegate:' in category from /opentok-ios-sdk/Opentok.framework/Opentok(OTPublisher+VideoSnoop.o) conflicts with same method from another category

可能性1:类别实例方法被声明两次. (在此处描述: SO )

Possibility 1: A category instance method is declared twice. (Described here: SO)

但是,当我搜索3个实例方法(在Xcode或Grep中)中的任何一个时,都找不到两次声明的实例.

But, When I do a search of any of the 3 instance methods (in Xcode or Grep) I do not find it declared twice.

可能性2:意外导入.m文件. (此处描述: SO )

Possibility 2: Accidentally importing a .m file. (Described here: SO)

但是,我检查了所有导入,并且在整个项目中只导入了一次框架.此外,在构建阶段仅显示一次.

But, I checked all my imports and I only import the framework once in the whole project. Also, only shows up once in Build Phases.

我的程序运行时没有崩溃,大概是因为使用了最后添加的类别定义,而且恰好是正确的. (来源)

My program runs without crashing, presumably because the last category definition added is used and it happens to be correct. (Source)

问题1:在添加之前,有没有办法说出这两个类别的位置?

Question 1: Is there a way to tell, prior to its addition, where the two categories are located?

问题2:关于如何解决此问题的其他想法?

Question 2: Any other ideas about how to resolve this?

注意:Opentok框架是二进制文件

Note: The Opentok Framework is a binary

出现在:

xcode 4.6& xcode 5

xcode 4.6 & xcode 5

iOS6& iOS7

iOS6 & iOS7

推荐答案

这看起来像是链接器错误.可能是SDK链接了不止一次,或者-ObjC丢失/出现在不应该出现的位置.检查链接器标志.尝试删除所有OpenTok框架,确保其在您的项目中丢失,然后重新下载并重新安装.

This look like a linker bug. Maybe the SDK got linked more than once, or -ObjC is missing/present where it should not be. Check linker flags. Try deleting all OpenTok frameworks, make sure its missing in your projects, then re-download it and install again.

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

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