Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Core Data export and mail in Xcode

I created an App that uses core data and I want to export the core data into a form that can be mailed and/or synced on a later version of this app. Can you please let me know 1- which form (XML, CSV, PDF...etc) is the best to export to from core date? 2- I need to send file via mail from the App itself so keep this in mind Appreciate if you could divert me to youtube tutorial or Stackoverflow question where I can find code for what I need. Thanks in advance for the help

like image 790
Farah Haddad Avatar asked Oct 16 '25 17:10

Farah Haddad


1 Answers

I was looking for the exact same thing. I am exporting my data to XML using this code: https://github.com/skjolber/xswi/blob/wiki/SerializingObjectsToXML.md

If you export each of your entities in Xcode (Click your Data Model and then click Editor > Create NSManagedObject Subclass) you can add the code to each of the subclasses.

From there you should be able to create an XML file with all your data.

like image 185
George Avatar answered Oct 18 '25 11:10

George



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!