我有一个 ParentViewController
类,它实现了一个 UITapGestureRecognizer
,目标方法被称为 tap
。我试图在子类 ChildViewController
中重写此方法,如下所示:
- (void) tap:(UITapGestureRecognizer *)sender
{
[super tap:sender];
}
它工作正常,但我收到警告:
'ChildViewController' may not respond to 'tap:'
在过去,当我覆盖委托(delegate)方法时,我真的没有遇到过这样的麻烦。我在这里缺少什么?
最佳答案
确保 -(void) tap:(UITapGestureRecognizer *)sender
在 ParentViewController.h 中定义
关于iphone - 无法摆脱继承的委托(delegate)方法警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10774980/