Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preserving core data after app update

I am using core data to store favorites chosen by the user. I would like to know that if I send an app update, how can I keep the data of the favorites preserved after the app is updated by the user?

I have read that you could use versioning, but I'm not sure if this the correct method.

Any help will be appreciated! Thanks

like image 729
Peter Avatar asked Apr 21 '26 03:04

Peter


1 Answers

If your app maintains the same bundle identifier and you don't copy over the core data store file, you keep it.

If you changed your Core Data model, then you do need to worry about versioning. Depending on changes you may need to write rules for migrating data in the old store to the new format. As you have probably experienced, if you change data structure and do not migrate (or wipe existing data), you crash.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!