0

I have a fairly complex Core Data database with many entities, attributes and relationships.

I need to take an NSManagedObject subclass object (or its data) and export it to another instance of the app. This other instance needs to then import it into its local database.

I have figured out how to attach files to emails however I am not sure if I should serialise the object to XML or if I should encode it using dictionaries.

It seems like a huge job either way, does anyone have any suggestions?

Community
  • 1
  • 1
TheLearner
  • 19,387
  • 35
  • 95
  • 163

1 Answers1

1

I dont know much about this but using dictionaries seems a better option to me as you will spare yourself xml writing and parsing, since you are using the same structure why bother with writing xml and parsing.. hope this helps.

update:

see this link.. https://stackoverflow.com/a/1375120/919545

Community
  • 1
  • 1
Ankit Srivastava
  • 12,347
  • 11
  • 63
  • 115
  • Problem is you can't actually encode an NSManagedObject as it isn't meaningful outside of its context. So I would have to create new classes and map between them – TheLearner Jan 25 '12 at 11:02