Mobileme syncing of core data persistent store
Mobileme syncing of core data persistent store
- Subject: Mobileme syncing of core data persistent store
- From: Martin Hewitson <email@hidden>
- Date: Wed, 7 Jul 2010 15:08:20 +0200
Dear list,
I have a core data app in which I have attempted to implement mobileme syncing. I have a helper class which implements the NSPersistentStoreCoordinatorSyncing protocol and I've implemented
- (NSArray *)managedObjectContextsToMonitorWhenSyncingPersistentStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator
- (NSArray *)managedObjectContextsToReloadAfterSyncingPersistentStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator
to return my single managed object context.
Everything is working sort of fine. The only problem is that changes synced from the cloud don't appear in the app until I restart it. The core data content is presented in an outline view / tableview combination.
I've implemented
- (ISyncChange *)persistentStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator willApplyChange:(ISyncChange *)change toManagedObject:(NSManagedObject *)managedObject inSyncSession:(ISyncSession *)session
and tried calling -refreshObject:mergeChanges: on the managed object. This doesn't help.
Does anyone know what I have to do to get the changes pulled from the cloud to immediately appear in the 'live' managed object context?
And a side question: is it possible to 'force' a mobileme sync from within the app, so that I can offer the user the ability to sync to the cloud before terminating the app?
Many thanks in advance,
Martin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer
Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: email@hidden
WWW: http://www.aei.mpg.de/~hewitson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden