简体   繁体   中英

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 wii 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM