Re: How to import data in Core Data app?
Re: How to import data in Core Data app?
- Subject: Re: How to import data in Core Data app?
- From: mmalc crawford <email@hidden>
- Date: Thu, 1 Mar 2007 23:25:34 -0800
On Mar 1, 2007, at 9:12 AM, Arthur C. wrote:
The question is how to handle this using Core Data. In the Core Data
Programming guide there is a topic on 'importing legacy data', but
that only covers the merging / removing duplicates issues. What I
would like to know is how to save things to file (another persistent
store?), and retrieve them again. That is, using as much of Core
Data as possible, as reading/writing to a file can of course be done
without the framework.
It's entirely up to you how you read and write the data.
In general, to read in:
Create an in-memory store.
Read in your objects, creating for each an instance of the relevant
entity.
(this is where the article in the Programming Guide is useful)
Re-create any relatonships (you'll have to give your objects IDs...)
to write out:
Fetch against each entity in turn
Write out each instance of each entity (make sure you write out
object IDs for relationships)
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