Core Data, bindings and synchronizing.
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