Murdock
Murdock

Reputation: 866

"'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:timerID];

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!

Upvotes: 0

Views: 147

Answers (3)

Julien
Julien

Reputation: 9442

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

Upvotes: 0

MarkPowell
MarkPowell

Reputation: 16540

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];

Upvotes: 1

Nicolas S
Nicolas S

Reputation: 5365

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

Just change your capitalization:

   [self displaySubviewPopup:currentPopup forTimerID:timerID];

Hope it helps!

Upvotes: 2

Related Questions