I’m currently using the MKHorizMenu class found here and I’m trying to understand why I am getting an instance method not found message.
I’m trying to have the app programatically do the equivalent of tapping on of the items on the view controllers first load.
My code:
// Actually select the item
[self.horizMenu.itemSelectedDelegate horizMenu:self.horizMenu itemSelectedAtIndex:0];
// Tap the button (change its background image etc)
NSArray *subs = [self.horizMenu subviews];
[self.horizMenu buttonTapped:(id)[subs objectAtIndex:0]]; // guilty line
The warning:
warning: instance method '-buttonTapped:' not found (return type defaults to 'id')
In the MKHorizMenu class the method is defined as:
-(void) buttonTapped:(id) sender
When I run the code, it performs as desired – it appears as if the first button has been tapped, and the first item is selected.
Why do I get this warning? How can I call buttonTapped properly here?
You can stop the warning by adding the method declaration for
buttonTapped:to the header file for the class.