I have an app where I have intergrated core data with iCloud. I have the following notifications in my view controller.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadFetchedResults:) name:NSPersistentStoreCoordinatorStoresDidChangeNotification object:coreDataController.psc];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadFetchedResults:) name:NSPersistentStoreDidImportUbiquitousContentChangesNotification object:coreDataController.psc];
The view controller contains a UITableView
that is loaded with core data using NSFetchedResultsController
. I am unsure what to put in the following method (called by the notifications above) to refresh the table. I have tried reloading the table, and refetching the data but to no avail. I know that the iCloud is doing its job because if I completely reload the viewcontroller the changed data shows.
- (void)reloadFetchedResults:(NSNotification*)note {
NSLog(@"Underlying data changed ... refreshing!");
//_fetchedResultsController=nil;
//[self fetchedResultsController];
[theTableView reloadData];
}
Any help will be greatly appreciated, Thanks!
NSFetchResultsController
delegate methods to re-fetch the data, (the bit commented out) but that also didn't work. – Eager Logic May 13 '13 at 9:13