soffes / ssdatakit

Eliminate your Core Data boilerplate code
MIT License
453 stars 57 forks source link

Crash in managed table and collection view controllers #24

Closed calebd closed 10 years ago

calebd commented 10 years ago

I have a collection view with a section that appears before all content fed by the fetched results controller.

I overrode viewIndexPathForFetchedIndexPath: and viewIndexPathForFetchedIndexPath: to return adjusted index paths, but neither of those methods are called in controllerDidChangeContent:. This results in invalid index paths being updated if the call was triggered by controller:didChangeObject:atIndexPath:forChangeType:newIndexPath:.

Additionally, both collection and table view controllers will update invalid index paths for changes triggered by controller:didChangeSection:atIndex:forChangeType: since the value for sectionIndex is not normalized by running it through viewIndexPathForFetchedIndexPath:. This affects all collection view controllers, and only table view controllers that return YES from useChangeAnimations.