• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: core data newbie Q
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: core data newbie Q
      • From: Daniel Child <email@hidden>
References: 
 >core data newbie Q (From: Daniel Child <email@hidden>)

  • Prev by Date: Java menu disappear, when NSOpenPanel is opened
  • Next by Date: Re: Converting uint16_t port to a NSString
  • Previous by thread: core data newbie Q
  • Next by thread: Re: core data newbie Q
  • Index(es):
    • Date
    • Thread