序言
假设,我有一个 iOS 应用程序,它是一个图书阅读器,它使用 Core Data 来存储图书数据。我的应用程序的第一个版本使用了一个相当简单的数据模型,稍后我将对其进行更新。我想通过“应用程序内购买”销售我的图书。
问题
如果我用新的数据模型更新应用程序,iOS 应用程序是否会负责将旧书转换为新版本的数据模型?比如说,iPhone 或 iPad 是否必须转换它们?当用户购买新版本的图书(在我的应用中)时,我将如何激励他们将他们的应用更新到新版本,同时仍然使用旧版本的应用?
最佳答案
要更新数据模型,您可以使用迁移。
参见:Core Data Model Versioning and Data Migration Programming Guide
...了解详情。请注意,在许多情况下您可以依赖自动迁移。
How will I motivate the users to update their apps to a new version when they buy books (in my app) in the new version, while still having an old version of the app?
您不想“激励用户”进行更新,因为这通常只是“强制用户”进行更新的礼貌说法。 Forcing your users to upgrade for anything other than unavoidable technical necessity is always a bad idea.
关于iOS,核心数据,更新数据模型 - 它是如何工作的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6275674/