简体   繁体   English

核心数据 - 提交应用商店更新

[英]Core Data - submitting app store updates

Basically when I have an application in XCode and I change the sqlite/coredata database and try to run it on a device that already has the application on it then the app crashes. 基本上当我在XCode中有一个应用程序并且我更改了sqlite / coredata数据库并尝试在已经有应用程序的设备上运行它时,应用程序崩溃了。 I have to remove the app and reinstall it. 我必须删除该应用程序并重新安装它。

I have updated the database on an app that has already been submitted to the app store. 我已经在已经提交到应用商店的应用上更新了数据库。 There has been about 100 downloads, and now I want to submit the update. 已有大约100次下载,现在我想提交更新。 Will people who have already downloaded it have problems with it? 已经下载过它的人会遇到问题吗? How would I make sure that they don't? 我怎么能确定他们没有? There won't be any data in the old database that I will need to be honest, but I'm worried that the app just won't start at all. 旧数据库中没有任何数据我需要诚实,但我担心该应用程序根本无法启动。

Thanks Tom 谢谢汤姆

From your description I can tell that you've changed the Managed Object Model withtout changing the store version. 从您的描述中我可以看出,您已经更改了托管对象模型而不更改商店版本。

Check out this tutorial (may be Mac version, but it should be valid) here . 看看这个教程(可能是Mac版,但它应该是有效的) 在这里

However, if you with to omit the migration (since you said users won't exactly have any data in the store) you can always change the store path so that it loads another store. 但是,如果您要省略迁移(因为您说用户不会在商店中确切地拥有任何数据),您可以随时更改存储路径以便加载另一个存储。 However, if you plan any updates and further developement of the app then i strongly recomend to read about core data migration. 但是,如果您计划对应用程序进行任何更新和进一步开发,那么我强烈建议您阅读有关核心数据迁移的内容。

Yes the app will probably crash when running with old db. 是的,当使用旧数据库运行时,应用程序可能会崩溃。

Apple released an interesting documentation about Core Data versioning and migration called: Core Data Model Versioning and Data Migration Programming Guide Apple发布了一篇关于Core Data版本控制和迁移的有趣文档,称为: 核心数据模型版本控制和数据迁移编程指南

If you read this document, you will learn how to avoid the crashes with updated coredata databases. 如果您阅读本文档,您将学习如何避免更新的coredata数据库崩溃。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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