Skip to content

Commit

Permalink
This should fix the bug where invalid sections are updated. As per ou…
Browse files Browse the repository at this point in the history
…r conversation @soffes.
  • Loading branch information
calebd committed Jan 4, 2014
1 parent fdb04f6 commit ea16854
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SSDataKit/SSManagedCollectionViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ - (void)controller:(NSFetchedResultsController *)controller
if (self.ignoreChange || ![self useChangeAnimations]) {
return;
}

NSIndexPath *indexPath = [NSIndexPath indexPathForItem:NSNotFound inSection:sectionIndex];
indexPath = [self viewIndexPathForFetchedIndexPath:indexPath];
sectionIndex = indexPath.section;

NSMutableDictionary *change = [NSMutableDictionary new];

Expand Down
4 changes: 4 additions & 0 deletions SSDataKit/SSManagedTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ - (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id
if (self.ignoreChange || ![self useChangeAnimations]) {
return;
}

NSIndexPath *indexPath = [NSIndexPath indexPathForItem:NSNotFound inSection:sectionIndex];
indexPath = [self viewIndexPathForFetchedIndexPath:indexPath];
sectionIndex = indexPath.section;

switch(type) {
case NSFetchedResultsChangeInsert: {
Expand Down

0 comments on commit ea16854

Please sign in to comment.