开发者

Why am I seeing the following warning: "Messages without a matching method signature wii be assumed to return 'id' and accept'...'as arguments "?

while wirting below code i have got the warning:"Messages without a maching method signature wi开发者_运维知识库i be assumed to return 'id' and accept'...'as arguments"

ViewSlider *viewSlider=[[ViewSlider alloc]init];
[viewSlider slideView:view1 secondView:view2]; 


Probably because the method related to

[viewSlider slideView:view1 secondView:view2];

does not appear in the header file of your ViewSlider.


Like unforgiven said, you probably want to declare it in the header file. This way, the compiler knows about the message when you're using it.

In Objective-C you can still send the message though, even if it's uknown to the compiler. But if the compiler doesn't know about it, it'll have to make some assumptions. Like the return type and the type of its arguments. That's what the warning is for: "Hey, look, you can send that slideView:secondView: message I never heard of but then I'm just going to assume it will return some object and accepts anything as it's parameters."


Have you imported the Files in the .m file...??? If not, declare the files of view1 & view2 in .m file. That might help.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜