Batch fetch with small data sets

This commit is contained in:
Ryan Nystrom
2015-02-26 15:40:06 -08:00
parent 8d7fe334e2
commit c657411a2e
6 changed files with 37 additions and 18 deletions

View File

@@ -392,11 +392,12 @@ static BOOL _isInterceptedSelector(SEL sel)
- (BOOL)shouldBatchFetch
{
if ([_asyncDelegate respondsToSelector:@selector(shouldBatchFetchForTableView:)]) {
// if the delegate does not respond to this method, there is no point in starting to fetch
BOOL canFetch = [_asyncDelegate respondsToSelector:@selector(tableView:willBeginBatchFetchWithContext:)];
if (canFetch && [_asyncDelegate respondsToSelector:@selector(shouldBatchFetchForTableView:)]) {
return [_asyncDelegate shouldBatchFetchForTableView:self];
} else {
// if the delegate does not respond to this method, there is no point in starting to fetch
return [_asyncDelegate respondsToSelector:@selector(tableView:willBeginBatchFetchWithContext:)];
return canFetch;
}
}