Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Core Data Model change app update

I would like to update my app, but I have completely changed the data structure, so is the Core Data model entirely different. Now, the data in the app does not have to be preserved, but you can't just update the app with this new model as it will crash.

What is the best way to update my app?

like image 864
thvanarkel Avatar asked Feb 28 '26 12:02

thvanarkel


2 Answers

You need to version the core data structure. Use this guide

http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/CoreDataVersioning/Articles/Introduction.html

like image 132
Rowdur Avatar answered Mar 03 '26 04:03

Rowdur


If you have a completely new data model you might look into having a new database persistent-store/db file and run a merge function if the app can find an old database.

like image 22
epatel Avatar answered Mar 03 '26 04:03

epatel



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!