How to prevent calling cellForRowAtIndexPath for off-screen cells inserted by NSFetchedResultsChangeInsert & insertRowsAtIndexPaths

I process XML and create managedObjects asynchronously. I have a table view that responds to this by inserting cells with NSFetchedResultsChangeInsert.

But all the cells inserted in the NSFetchedResultsChangeInsert and insertRowsAtIndexPaths tables start cellForRowAtIndexPath and willDisplayCell. Even when they are not on the screen. This leads to unnecessary cell processing, which should only be performed when the cell is actually visible.

How to dynamically insert objects into a table through NSFetchedResultsChangeInsert without causing rendering when they are not displayed on the screen?

+3
source share
1 answer

Task found. I think that all CoreData objects ran NSFetchedResultsControllerDelegate methods because I saved the context with all the objects at the end. If I keep the context after each created object, I see only cell updates for those cells that are visible.

+1
source

All Articles