Prefill information in Core Data at startup.

后端 未结 2 1439
一向
一向 2020-12-20 07:05

I have to do an iOS application that used core data to store the information.

I created the model and how to add data into the application, everything is working per

相关标签:
2条回答
  • 2020-12-20 07:11

    Take a look at some of the sample apps, like the iPhone Core Data Books. Basically you ship a pre-filled database with your app, and on initial startup your app delegate copies it into the application's Documents directory, using the data you populated in the database.

    0 讨论(0)
  • 2020-12-20 07:11

    As I recall, you can't start with a pre-built data store with Core Data--you'll have to create your store on first run.

    Apple's tips and tricks for this initial import can be found here. 98% of the time, it's best to just follow along with their docs.

    0 讨论(0)
提交回复
热议问题