开发者

Completely replacing iOS Core Data Model

开发者 https://www.devze.com 2023-03-10 08:40 出处:网络
I am doing an update to my application and am looking to replace the entire Core Data Model. It would be more efficient to just remove all of the existing entities and then rebuilding them in after th

I am doing an update to my application and am looking to replace the entire Core Data Model. It would be more efficient to just remove all of the existing entities and then rebuilding them in after the user updates the application from the App Store.

I have re开发者_开发问答ad the Core Data Model Versioning and Data Migration Programming Guide from Apple, but I'd rather not fool around with the versioning and migration since I would prefer just to start from scratch.

If I just submit the application with the new data model, will the existing users crash just like what happens when you don't delete the application from the simulator?


You may want to write some logic to migrate data from old model to new once the user upgrades the app... preferably in your appdelegate first time launch. I did something similar with my app... it went smooth. Edit: Also I kept my old model intact in the app, and deleted it after few months.


Yes. It'll crash. If you want a fresh start you should delete your old persistent store and create a new one on first launch.

0

精彩评论

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