简体   繁体   中英

Core Data Users Need Data from Old Version of App

My iPad app uses Core Data and I've recently run into a problem. I had users using a test version of my app but now that the app is in production they want to keep the data they had before. Problem is the data model has changed. I wasn't anticipating the users needing the data so I didn't create a new version of the model. I'm looking for a way to move the data to the new version of the app but I'm not sure how. The app is in the store already so I don't want to change the app if possible. I was thinking about creating an app that would read the sqlite database and insert the records into the new version but I'm not sure if that would work. Thanks.

First of all you should read this guide

So now you can see, that core data model has versions. You must determine if changes are lightweight and core data can handle them automatically, other way you should perform migration with mapping models

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM