Johan Nystrom
Johan Nystrom

Reputation: 157

Core Data XML import/export of single object

With Core Data, specifically on Cocoa Touch, is it possible to export and import individual objects in XML format (irrespective of the underlying store format, ideally)?

I'm asking this because I'm using Core Data to manage my object graph anyway, and I need to send and receive my objects in XML format with HTTP. So it would be convenient for me if there were special convenience functions for this kind of import/export.

Upvotes: 2

Views: 4283

Answers (3)

ThomasRS
ThomasRS

Reputation: 8287

You might be interested in this kind of approach, although it only covers writing XML.

Upvotes: 0

Meltemi
Meltemi

Reputation: 38359

Not sure exactly what your intention is or how complex your objects are so this may be off the mark but...have you thought about making your objects conform to the NSCoding protocol? Doing so should allow you to serialize them to disk or wherever outside Core Data.

Upvotes: 0

Hunter
Hunter

Reputation: 4371

Sure, it is possible. You'd just have to write the code.

Core Data doesn't have any special import or export routines if that's what you're asking.

There is a section in the Core Data Programming Guide that talks about data import strategies.

Upvotes: 2

Related Questions