jeudi 24 septembre 2015

iOS - Importing data into CoreData

I need to import some data in the db of an iOS (7+) app.

As I'm working with Coredata the best way seems to create a seed db: http://ift.tt/1Fi8pa5 This means I have to create a second project (eg: desktop app) which takes care to create and populate the db.

My first concern is: should the db model of this project be the same of the app one? Therefore if the app has a db with many entities, the entire structure must be replicated in the model of second project, and for any future update the two structures must be kept alike. Am I correct?

This seems quite demanding to be done and maintained, moreover the process of finding and copying the seed sqlite file is not straightforward.

That said, as I need to import about 80k entries into a single table, what about including a csv file in the iOS app and import all the data at the first launch?

Thanks for any hint, DAN

Aucun commentaire:

Enregistrer un commentaire