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: martin.hewit...@aei.mpg.de
WWW: http://www.aei.mpg.de/~hewitson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to