由于“多个方法命名",无法在 Xcode 4.5 中构建错误 [英] Can't build in Xcode 4.5 because of "Multiple methods named" error

查看:20
本文介绍了由于“多个方法命名",无法在 Xcode 4.5 中构建错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Xcode 4.5 中构建项目时遇到问题.Xcode 给了我这个错误多个名为‘item’的方法发现结果、参数类型或属性不匹配".有人能告诉我问题是什么吗?如何解决多个方法名称错误?

I'm having problems with building my project in Xcode 4.5. Xcode gives me this error "Multiple methods named 'item' found with mismatched result, parameter type or attributes". Can someone tell me what the problem is? how to resolve multiple methods names error?

推荐答案

您可能有不同的类实现了 item 方法,但返回了不同类型的结果.如果您随后尝试在 id 类型指针上调用 item,则无法知道结果类型应该是什么.

You probably have different classes implementing the method item but returning a different type of result. If you then try to invoke item on an id typed pointer, there's no way to know what the result type is supposed to be.

这就是 XCode 所抱怨的.

That's what XCode is lamenting about.

如何解决在很大程度上取决于您真正想要做什么.可能对方法使用不同的名称是最好的解决方案.

How to solve it depends a lot on what are you really are trying to do. Probably using different names for the methods is the best solution.

这篇关于由于“多个方法命名",无法在 Xcode 4.5 中构建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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