Re: Core Data, bindings and synchronizing.
Re: Core Data, bindings and synchronizing.
- Subject: Re: Core Data, bindings and synchronizing.
- From: "Gustavo Vera" <email@hidden>
- Date: Fri, 16 Feb 2007 04:50:19 -0300
moc sync is not an easy task (at least not in my case) even in the best case
scenarios suggested at: <
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdChangeManagement.html
To achieve this, I´m using a combination of subscriptions to some change
notifications throwed when the objects in any context are saved, and also
(and for UIs that relies on different mOCs) some changes using categories
on NSArrayControllers, that allows me to properly refresh the changes in the
related contents.
The suggested 'reset' at the 2nd case at 'Communicating Changes Between
Contexts' on the related link, is, in my case, useless. When you reset a
mOC, every connected array controller is emptied, and you loose every entity
selection on it (It does not matter if you did not change the objects).
A good reason (in my case) to maintain N contexts synchronized, is to be
able to provide transactional support. I think you couldn't provide this
with only one mOC in your app.
On 2/12/07, email@hidden <
email@hidden> wrote:
Date: Mon, 12 Feb 2007 13:23:09 -0800
From: mmalc crawford <email@hidden>
Subject: Re: Core Data, bindings and synchronizing.
On Feb 12, 2007, at 10:23 AM, Ryan Homer wrote:
> 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.
>
It's not clear why you wouldn't know when you're no longer using an
object...
> Is anyone somehow keeping the two instances of the moc in sync?
>
Further to Michael's comment that you haven't given a good reason for
maintaining two contexts:
<
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdChangeManagement.html
>
mmalc
_______________________________________________
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