What do I have to do to get Core Data to automatically migrate models?

前端 未结 10 1899
感情败类
感情败类 2020-11-27 09:14

I have read the documentation about automatic /lightweight migration for Core Data models - but I am having problems implementing it.

As I understand it the applicat

10条回答
  •  野性不改
    2020-11-27 09:30

    Also, if you stumbled upon this post, like I did, after getting the "The model used to open the store is incompatible with the one used to create the store" error and you are just debugging using the simulator and wanting to completely replace the old model installed, you can just Reset the Simulator app or deleting your app from the simulator would probably work as well.

    It didn't occur to me to try this until reading the posts here, at which point I realized that I had installed the app in the simulator and then subsequently changed the model, causing the aforementioned run-time error.

提交回复
热议问题