我做了下面的代码,检查,如果超级实现该方法(使用respondsToSelector)
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
if ([super respondsToSelector:@selector(scrollViewWillBeginDragging:)]) {
[super scrollViewWillBeginDragging:scrollView];
}
self.scrolling = YES;
}
但它评估为 YES 并且它在无法识别的选择器上中断
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[InputFormViewController scrollViewWillBeginDragging:]: unrecognized selector sent to instance 0x17da8670'
这是期望的(错误)行为,还是我在做某事。错误的?
注意:超类是
@interface FormBaseViewController : UIViewController<UITableViewDataSource, UITableViewDelegate>
没有实现(scrollViewWillBeginDragging:)