small medium large xlarge

Back to: All Forums  Core Data
Generic-user-small
28 Jul 2009, 17:35
Kevin Ross (1 post)

My application is a core data document based app and I have an entity in my data model that has no relationships to any other parts of the model. What would be the recommended way for me to migrate this entity to another model in the same document? Will it require a manual migration of the persistent stores? I’d like to eventually move the other part of the model to a separate framework that I want to shared between this app and an iphone app. Are there any caveats to doing things this way?

Thanks for your insight, I love the book!

Avatarsmall_pragsmall
25 Aug 2009, 16:20
Marcus S. Zarra (284 posts)

Moving an object/entity/instance from one model to another requires copying the object over. We do this in the multi-threading chapter which you can refer to. What you need to do is create an instance of the object in the new model, copy over the properties, sync up any relationships and then delete the object out of the old context. A little bit of coding but not too bad thanks to KVO.

You must be logged in to comment