On Dec 30, 2009, at 14:08:15, Mike Abdullah wrote:

> 
> On 30 Dec 2009, at 21:58, Rick Mann wrote:
> 
>> 
>> On Dec 30, 2009, at 13:54:10, mmalc Crawford wrote:
>> 
>>> 
>>> On Dec 30, 2009, at 12:54 pm, Rick Mann wrote:
>>> 
>>>> In my app I have a situation where I have two (Core Data) documents open, 
>>>> and I need to merge all the changes made in one doc1 to the changes in 
>>>> doc2. I've been reading the section on Change Management in the Core Data 
>>>> Programming Guide, but it just talks about the caveats and gotchas, and 
>>>> doesn't actually talk about how to effect the merge. It also only talks 
>>>> about the example where the two MOCs share a single file, which is not the 
>>>> case here.
>>>> 
>>> Then you're not merging, you're copying/moving objects from one store to 
>>> another.
>> 
>> Is that operation discussed in the docs somewhere?
> 
> It's pretty much the same as any other operation on with a MOC. You cannot 
> copy or move a managed object from one MOC to another in a simple fashion. 
> Instead, you have got to create new, corresponding objects in the second MOC, 
> and then (if needed) delete the old objects from the first MOC.

Really? There's no way to associate the MOC with the persistent store of an 
existing doc, and then do a save operation, and have the objects transferred 
automatically? Because it seems like Core Data supports creating a second MOC 
on an existing persistent store and then saving.

My problem is that in some situations, new data is being added to an existing 
store, or a new store, and in some situations, data from an existing store is 
being edited in a separate MOC (never in the original MOC).

So, you're saying I just have to manually create corresponding objects and copy 
all the property values over?

-- 
Rick

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to