• 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
Core Data, bindings and synchronizing.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data, bindings and synchronizing.


  • Subject: Core Data, bindings and synchronizing.
  • From: Ryan Homer <email@hidden>
  • Date: Mon, 12 Feb 2007 13:23:06 -0500

Hello all. Let's say we have a class that encompasses an NSManagedObjectModel, NSPersistentStoreCoordinator and NSManagedObjectContext (moc). If the header file is imported into IB and a class is instantiated, an array controller can then make use of the moc and be bound to a view via Core Bindings.

Now, let's say that I use another separate instance of this class in another part of my code, not bound to any view, and that I use this class to manipulate some data. For example, I might want to add a new "record" (entity?) to my data.

This does NOT automatically update my view because there are now two instances of the moc and each is in a different state. I have tried using a shared moc and this DOES indeed keep the view in sync with my background data changes, but I was wondering what solutions others have used in cases like this. One immediate "situation" that arises is that there is now no simply way to know when we are no longer using the moc and therefore release it from memory.

Is anyone somehow keeping the two instances of the moc in sync?

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: Core Data, bindings and synchronizing.
      • From: mmalc crawford <email@hidden>
    • Re: Core Data, bindings and synchronizing.
      • From: Michael Jurewitz <email@hidden>
  • Prev by Date: Re: how to set the shortcut key in the interface builder?
  • Next by Date: Re: Core Data, bindings and synchronizing.
  • Previous by thread: background color of NSTextView
  • Next by thread: Re: Core Data, bindings and synchronizing.
  • Index(es):
    • Date
    • Thread