How can I ship my app with a pre-populated Core Data database?

后端 未结 5 1400
天涯浪人
天涯浪人 2021-02-01 08:16

My app uses Core Data and I want some default entries to be inside. What\'s best practices of how to do that?

5条回答
  •  醉话见心
    2021-02-01 08:49

    See the CoreDataBooks example, which has sample code for copying a database at first launch.

    EDIT: I've created a Core Data framework (read about it here: http://bikepress.org/?p=1120) that includes this feature.

提交回复
热议问题