Hi,
Been browsing through the posts similar to this one but none answered my problem.
Like CoreDataBooks, I use a separate MOC for adding and editing items and observe the proper notifications, like so:
- (void)addControllerContextDidSave:(NSNotification*)saveNotification {
NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext];
// Merging changes causes the fetched results controller to update its results
[context mergeChangesFromContextDidSaveNotification:saveNotification];
NSLog(@"merging changes in rootview");
}
When I do a save, it's observed correctly. Debugging the notification shows the right context, and debugging the context shows the just added item. The log message also prints just fine. But nothing happens. None of the delegate methods of the NSFetchedResultsController fire, nor is the table view updated.
I tried no cache or clearing it. I've tried reloadData
on the tableView, but nothing.
When I quit the app and restart, it shows up fine.
UPDATE:
The notification does indeed contain the right context as its object
, which contains the correct item, but the userInfo
hash has nothing in it:
userInfo = {
inserted = "{(\n)}";
updated = "{(\n)}";
}
So it looks like the notification doesn't have any changes in it, despite having the correct context with the changed item.... hmmmm.