Fix invalid table controller delegate invocation. fixes #683, closes #659

Rename didFinishFinalLoad to didFinalizeLoad for clarity.
This commit is contained in:
Blake Watters
2012-04-17 22:54:10 -04:00
parent 670375deb9
commit 4ac6a76485
4 changed files with 34 additions and 8 deletions

View File

@@ -289,7 +289,7 @@ extern NSString* const RKTableControllerDidBecomeOffline;
/** Sent to the delegate when the controller is really and truly finished loading/updating, whether from the network or from Core Data, or from static data, ... this happens in didFinishLoading
**/
- (void)tableControllerDidFinishFinalLoad:(RKAbstractTableController *)tableController;
- (void)tableControllerDidFinalizeLoad:(RKAbstractTableController *)tableController;
/**
Sent to the delegate when the content of the table view has become empty

View File

@@ -755,8 +755,9 @@ static NSString* lastUpdatedDateDictionaryKey = @"lastUpdatedDateDictionaryKey";
[self resetOverlayView];
if (self.delegate && [_delegate respondsToSelector:@selector(tableControllerDidFinishFinalLoad:)])
[_delegate performSelector:@selector(tableControllerDidFinishFinalLoad:)];
if (self.delegate && [_delegate respondsToSelector:@selector(tableControllerDidFinalizeLoad:)]) {
[_delegate performSelector:@selector(tableControllerDidFinalizeLoad:) withObject:self];
}
}
#pragma mark - Table Overlay Views

View File

@@ -194,11 +194,12 @@
}
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:self.defaultRowAnimation];
// TODO: We should probably not be making this call in cases where we were
// loaded via a network API, as we are duplicating cleanup effort that
// already exists across our RKRequestDelegate & RKObjectLoaderDelegate methods
[self didFinishLoad];
// The load is finalized via network callbacks for
// dynamic table controllers
if (nil == self.objectLoader) {
[self didFinishLoad];
}
}
- (void)loadObjects:(NSArray *)objects {