Re: core data newbie Q
Re: core data newbie Q
- Subject: Re: core data newbie Q
- From: Andrew Kimpton <email@hidden>
- Date: Tue, 5 Jun 2007 09:38:02 -0400
On Jun 5, 2007, at 9:24 AM, Daniel Child wrote:
Hi,
I have been reading up on the Core Data documentation. One thing I
don't see answered in the documentation is how you can import data
that is not in XML, SQLite, or binary format.
In other words, what steps would you take to import a comma- or tab-
delimited flat file.
Don't confuse the internal storage formats that CoreData uses with
what can be imported. The two are not connected, primarily because
importing data is entirely your responsibility. Your app needs to
parse the input file using NSScanner (or whatever other tools you
wish to use), create an NSManagedObject (or child class) instance,
using insertNewObjectForEntityName and then set the appropriate
values on it from the results of your parsing.
The Core Data Programming Guide has a section 'Efficiently importing
legacy data' which goes over some of the 'gotchas' that you might run
into (see also other recent posts about autorelease pools and
CoreData memory usage if you're importing thousands of objects).
Andrew 8-)
_______________________________________________
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