开发者

"'ViewController' may not respond to ..." warning when I *have* declared the method in @interface

I'm probably making a dumb mistake here, but I've been staring at my code and can't figure out what the problem is. I have a method defined in the @interface of my ViewController .h file as such:

- (void) displaySubviewPopup:(PopupView *)currentPopup forTimerID:(int)timerID;

Then in my .m file I implement the method as such:

- (void) displaySubviewPopup:(PopupView *)currentPopup forTimerID:(int)timerID {

...method implemented here...

}

And then elsewhere in my code I'm calling the method as such:

   [self displaySubviewPopup:currentPopup fortimerID:time开发者_运维知识库rID];

But for some weird reason I'm getting the ol' "May not respond to..." compiler warning "warning: 'SwimTimerViewController' may not respond to '-displaySubviewPopup:fortimerID:'"

I'm probably missing something simple here, but like I said, I've been staring at my code and my brain is starting to fizzle trying to figure out what I overlooked here. It seems like my method implementation is correct...

Any ideas? I can post more code if need be, but that's the gist of it.

Thanks!


Really easy answer for clean eyes, happens really often though.

Just change your capitalization:

   [self displaySubviewPopup:currentPopup forTimerID:timerID];

Hope it helps!


fortimerID does not match your definition. Notice the lower case t.

Just fix the capitalization issue and you should be all set:

[self displaySubviewPopup:currentPopup forTimerID:timerID];


If your code is copy pasted, then it's a typo : you used fortimerID instead of forTimerID (capital T)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜