Keeping Managed Object Contexts synchronized?
Keeping Managed Object Contexts synchronized?
- Subject: Keeping Managed Object Contexts synchronized?
- From: Jim Correia <email@hidden>
- Date: Tue, 28 Jun 2005 16:51:10 -0400
I have a CoreData application which is using one managed object
context per editing window (like the CoreRecipes example.)
When the context is saved in one window, I'd like the other window to
update to reflect the new contents (insertions, deletions, and
property changes.
For property changes, I tried the approach in CoreRecipes where I
refault the objects in response to a
NSManagedObjectContextDidSaveNotification.
This seems to work for the first property change after the fetch,
then doesn't update the other window unless I explicitly tell the
controller to fetch (or bring the window forward which causes a fetch
internally.)
For insertions and deletions, is my only resource to know which
controllers care about the data, and have them listen for the
notification and refetch as appropriate?
Simplified demo/example at <http://homepage.mac.com/jimcorreia/tmp/
KeepingMOCsSynchronized.zip>.
Thanks,
Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden