7

Provide basic data for the application of master data?

 2 years ago
source link: https://www.codesd.com/item/provide-basic-data-for-the-application-of-master-data.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Provide basic data for the application of master data?

advertisements

I'm working on a Core Data app (for iPhone 3.0, though I don't think that really makes a difference here) and it will need to ship with a "starter" database filled with data. With SQLite, I would just have the App copy the populated database from the bundle into the App's documents directory on first launch and then load that database - all the information would come along with it and we'd be ready to go. But with Core Data, I'm not really sure if I can just save the Persistent store to the App bundle and copy it before having Core Data start doing its thing. Will this cause any problems? There is quite a bit of initial data, so I don't want to package it in another format and have to parse through it.


Yes, you can copy over a pre-populated persistent store.

I created a Mac app that populates a store. It is copied into my bundle and at start, copied to the Docs directory. This works fine. I am told the Core Data Books example was developed the same way.

Please note this doesn't mean you can just copy over any old SQLite file. It has to be a Core Data persistent store, though I think you understand that based on your question.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK