On Mar 30, 2011, at 4:09 PM, Nick Zitzmann wrote: > > On Mar 30, 2011, at 2:05 PM, Carter R. Harrison wrote: > >>>> 2. What is the best way to implement it? >>> >>> Put your CoreData code into a framework shared by your applications. And >>> use distributed notifications to keep the applications in sync. >> >> So when one application saves the data store, then it sends a distributed >> notification to tell the other application to reload its object graph? > > Something like that. Or you can send a notification containing the IDs of the > managed objects that were changed in the other app, and have your handler > re-fault its managed objects if necessary so that it'll have the latest > information when it un-faults them later. >
I really appreciate all of your help. I gave your suggestion a shot and I've run into problems. Here's what happens. 1. I create a new NSManagedObject in my main application. It gets inserted into the context. 2. I save the context. I can see the persistent store update in a text editor (its an XML store). 3. I send a distributed notification with the NSManagedObject's ObjectID. 4. My background application consumes the notification and uses the object ID to get an NSManagedObject (using [NSManagedObjectContext objectWithID:]. This produces an NSManagedObject that is a fault. 5. I try to fire the fault by using [NSManagedObject valueForKey:]. 6. Step 5 results in an exception "CoreData could not fulfill a fault for '0x1001029e0 <x-coredata://BB194166-B2FB-48ED-8177-E66F95B6CA3A/Alert/p118>'" I'm not sure I understand why this is happening. If the object is truly a fault then shouldn't Core Data go back to the persistent store to find the object? > Nick Zitzmann > <http://www.chronosnet.com/> > _______________________________________________ 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