您的位置:首页 > 移动开发 > IOS开发

iOS/Xcode异常:no visible @interface for XXX declares the selector YYY

2014-07-08 15:00 921 查看


在iOS/Xcode开发过程中,出现如下异常信息:
no visible @interface for XXX declares the selector YYY
分析原因:
There are lots of reasons it could happen, but generally it’s saying that at the line of code it flags, it doesn’t see any evidence that the selector you are referencing is in the interface of the type it thinks the object has.
有很多原因导致这一情况发生,但是一般而言,发生异常的代码行,指没有在interface接口文件中,找到任何你引用的selector(方法)。有可能是没有在interface进行声明定义,也有可能是字母输入错误。  没有在.h文件中申明方法

Local
declaration of 'XXX'
hides instance
variable遇到这种原因,是因为本地变量跟函数参数变量同名。

1.在targets->build phases中修改compilerFlags属性,添加:-fobjc-arc,就可以让旧的工程支持arc;
 
2.在targets->build phases中修改compilerFlags属性,添加:-fno-objc-arc,就可以让原来支持arc的工程不使用arc,对于大部分第三方类库来说都可以顺利编译通过
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐