Luke Stephens
Luke Stephens

Reputation: 3

Updating an iOS app on the AppStore which uses CoreData

I know there are similar questions on this subject but nothing that quite answers my query. I am aware that it is a bit of a newbie question!

I have an app on the AppStore which I will soon be looking to update. My binary contains a pre-loaded sqlite file with a list of data which the user starts off with. However, the user will extensively edit this information and it is crucial that that data is maintained through the update.

I am not changing the CoreData structure at all so won't be performing any migration but my concern is that when I upload the new binary the packaged sqlite file will overwrite the users existing data. I suspect that won't be the case but can anyone shed any light on it?

Upvotes: 0

Views: 249

Answers (1)

jrturton
jrturton

Reputation: 119242

When updating an application the documents directory is untouched. Presumably your startup code checks to see if you have already copied the initial database from the bundle to the documents directory - this will work the same way after an upgrade.

You are testing this every time you run a new build on your device during development anyway - you've put a whole new version of the app bundle on there, and it doesn't kill all your data, does it? (does it???)

Upvotes: 1

Related Questions