• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Keeping Managed Object Contexts synchronized?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Prev by Date: indexOfItemWithStringValue gets a nil string?
  • Next by Date: [ot] safari's bookmark plist: a Bookmark Proxy Identifier
  • Previous by thread: indexOfItemWithStringValue gets a nil string?
  • Next by thread: [ot] safari's bookmark plist: a Bookmark Proxy Identifier
  • Index(es):
    • Date
    • Thread