Fix issue where grouping objects by section in RKTableController and loading an empty collection would fail to refresh table view.

This commit is contained in:
Blake Watters
2012-05-25 13:45:30 -04:00
parent fa88dd44ef
commit 8647fa5f42
3 changed files with 46 additions and 0 deletions

View File

@@ -314,6 +314,9 @@
if (self.sectionNameKeyPath) {
NSArray *sectionedObjects = [objects sectionsGroupedByKeyPath:self.sectionNameKeyPath];
if ([sectionedObjects count] == 0) {
[self removeAllSections];
}
for (NSArray *sectionOfObjects in sectionedObjects) {
NSUInteger sectionIndex = [sectionedObjects indexOfObject:sectionOfObjects];
if (sectionIndex >= [self sectionCount]) {