mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-21 09:55:49 +08:00
Mehod -numberOfSectionsInTableView: is optional but not conditionally checked
The documentation for `UITableViewDataSource` specifies that the default value is 1, and that its implementation is optional. However, ASTableView's forwarding doesn't account for the unimplemented case. The desired behavior is to return 1 in the case that the method is not implemented.
This commit is contained in:
@@ -317,7 +317,11 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
- (NSInteger)rangeControllerSections:(ASRangeController *)rangeController
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
return [_asyncDataSource numberOfSectionsInTableView:self];
|
||||
if ([_asyncDataSource respondsToSelector:@selector(numberOfSectionsInTableView:)]) {
|
||||
return [_asyncDataSource numberOfSectionsInTableView:self];
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSInteger)rangeController:(ASRangeController *)rangeController rowsInSection:(NSInteger)section
|
||||
|
||||
Reference in New Issue
Block a user