Core data - loading a subtree of objects
Core data - loading a subtree of objects
- Subject: Core data - loading a subtree of objects
- From: Gideon King <email@hidden>
- Date: Sun, 14 Feb 2010 14:34:20 +1000
Hi, I have an application where I have a model for all the data of the application, but sometimes I want to replace a subtree within the object graph with a new set of objects loaded from a file. I am looking for advice on the best way to handle this.
If I created a completely separate model, then I would have to have a lot of the same object definitions in both models, and maintenance would be a nightmare.
These same classes are necessary in both the main data and the subset, so I don't think that the merged models thing works.
One thing I thought was the possibility of loading it using the same persistent store definition, but when it is that file type, it will just load this subset of the objects (it's an NSAtomicStore subclass) into a separate context, and then I use the objects from that context and migrate them to my main document context, replacing the objects that are there. Would that be a good solution?
Any advice on how to handle this would be very welcome.
Thanks
Gideon
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden