I'm developing a new Core Data app and I created an NSArrayController (Entity Mode) to make bindings, it works very well but when the SQLite store changes (changes come from other clients using TICoreDataSync library) I force a tableView reload with no success. Here the code:
NSError *saveError = nil;
[self.managedObjectContext save:&saveError];
if (saveError != nil) {
NSLog(@"%s %@", __PRETTY_FUNCTION__, saveError);
}
[arrayController fetch:nil];
[tableView reloadData];
If I close the app and start it again I can see changes in my tableView but I would like it to refresh automatically. Thanks in advance.
Are you calling
mergeChangesFromContextDidSaveNotification:
to update your context when TICDS makes changes?You should implement this delegate method:
Make sure you invoke
mergeChangesFromContextDidSaveNotification:
on the appropriate thread.Also worth looking at a sync framework I am developing called Ensembles. TICDS is not being maintained very much these days — I've worked on it in the past — and Ensembles is quite a bit easier to use.