[英]How can I delete the user's previous version of ios app when user go to AppStore update the app
I have a ios app in AppStore and I want to upload a new version.我在 AppStore 中有一个 ios 应用程序,我想上传一个新版本。 But the problem is there is a database in app, and I set the different table structure in new version, so if user already have the previous version app and then download the new version, It will got some error because of the database modified structure.
但是问题是app里面有一个数据库,我在新版本中设置了不同的表结构,所以如果用户已经有以前版本的app,然后下载新版本,由于数据库结构修改,会出现一些错误。 So I want to know if there is any way that can prevent this situation in App Store Connection, like auto delete the previous version and then reinstall the new version when user update the app.
所以我想知道是否有任何方法可以防止App Store Connection中出现这种情况,比如在用户更新应用程序时自动删除以前的版本,然后重新安装新版本。 Please help me, thanks.
请帮助我,谢谢。
This is a common situation.这是一种常见的情况。 You have to write migration code that will detect the old existing database and modify it, converting it to the new structure.
您必须编写迁移代码来检测旧的现有数据库并对其进行修改,将其转换为新结构。 Typically you'll do this at launch time on a background thread.
通常,您会在启动时在后台线程上执行此操作。
So this has nothing to do with the overall app installation or with the App Store.因此,这与整体应用程序安装或 App Store 无关。 It is entirely your responsibility.
这完全是你的责任。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.