views:

44

answers:

1

Hi all, In my app I want to load some initial data to show the user how it works. The app uses a CoreData managed sqllite db.

SO far I've thought of 3 options:

  1. Write code into a class to programmatically create the data.

  2. Create a xml file in the apps resources and load through a NSXmlParser whose delegate creates the entries in the sqllite db.

  3. Same as option #2, but use a json file and bring in a 3rd party lib to read it.

Are there other options I have not found yet? and given that I'm talking about perhaps 6 records per table when there are 3 tables, which would you choose?

+1  A: 

Writing it in the code might be not such a great solution... For option b: I would recommend the TBXml-Parser. It's very fast! http://www.tbxml.co.uk/TBXML/TBXML_Free.html

My choice would be the XML-File (You are more free, it's easy to parse it and to have a "quick look" in it)

Don't forget to make it localizable!

antihero