I have a Table View that fetches data from Core Data using FetchedResultsController and it registers for the data update.
On a second thread, I download the data from the server and update the same data (that's used by the Table View). The update is not complicated: it is just updating a BOOL field of the entity.
When I call the save on Object Context, I get this exception: NSInternalInconsistencyException. And the reason is "Failed to process pending changes before save. The context is still dirty after 100 attempts. ..." If I do not save right after the update but only at the time when the application is about to terminate, the application runs fine and the Table View is correctly updated and the data is persisted.
Any pointer on why that might be happening? Am I doing something wrong?