deliver core-data app with content

I have a core-data app about plants and would like to deliver the app with 50 plants for the user. However when I upload the file into iTunes Connect the data is not included. What can I do to have the data (sqlite) included?

Replies

If it's not in iTunes Connect it means that that file isn't in your app's resource bundle.


You've got three main options:

  • If you just need read only access to that data store, you can just put the SQLite file in you app bundle and set the read-only option when you connect it. Keep in mind that you can connect multiple data stores in Core Data, it's just a bit more work and less common to do.
  • Host the SQLite file on a web server and add code to let the user download the data.
  • Adid code to your app to build the 50 entities when you detect an empty data store.

There's another option--add the SQLite file to your app bundle and copy it to the sandbox on first launch--but that's strongly discouraged due to the iCloud backup limits. If it looks like you're creating a big file without user interaction, you'll get trouble from App Review.