开发者

Core Data Model change app update

开发者 https://www.devze.com 2023-04-09 07:40 出处:网络
I would like to update my app, but I have completely changed the data structure, so is th开发者_运维知识库e Core Data model entirely different. Now, the data in the app does not have to be preserved,

I would like to update my app, but I have completely changed the data structure, so is th开发者_运维知识库e 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?


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

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号