Reputation: 1208
I recently updated my app with a new version in app store.My users experienced a crash after updating the app.If the user deletes the older app and downloads the app as a new app from the store the app works as desired.
The change i have done is included a new entity in my core data file for a functionality which is located in documents directory in the sandbox compared to older version.When the app is updated from the app store will the core data file be updated with new entities and properties?
In simulator if i include a new entity and run the app without removing build the app crashes and the crash gets resolved if i remove the build and run it again.
I hope this(New core data entity) is the cause for the crash when updated from the store.Could someone suggest how to overcome this.When the user updates the app, the core data file should be also updated.. How can i implement this plz help.
Thanks in advance.
Upvotes: 3
Views: 2192
Reputation: 34265
If you change the database structure across version, you must add database migration logic in your code. You can't just expect app to automatically work across different database versions.
Read this stackoverflow post which gives you some useful informations.
Apple's documentation about the subject is here. A good tutorial here.
Upvotes: 7