简体   繁体   English

iCloud和轻量级迁移

[英]iCloud and lightweight migration

I've a published app synchronizing a Core Data with iCloud. 我已经发布了一个应用程序,用于将Core Data与iCloud同步。 I need to update the model adding two attributes and then populate these new fields. 我需要更新模型,添加两个属性,然后填充这些新字段。

I've tested lightweight migration locally and works fine, I can see the old data migrated into the new model scheme. 我已经在本地测试了轻量级迁移,并且工作正常,可以看到旧数据已迁移到新模型方案中。

When I activate iCloud, old data saved in the ubiquity container doesn't sync with the new model schema. 当我激活iCloud时,保存在无处不在容器中的旧数据不会与新模型架构同步。 What is the expected behavior? 预期的行为是什么? Should I be able to sync data both on old and new model versions? 我应该能够同时在新旧型号上同步数据吗? How can I achieve it and test this situation? 如何实现并测试这种情况?

I've read: 我读了:

CoreData versioning and CoreData版本控制

Understanding Core Data iCloud Store Migration When Testing an iOS App Update 测试iOS应用更新时了解核心数据iCloud Store迁移

but, actually, I'm very confused. 但是,实际上,我很困惑。

What's supposed to happen is that iCloud data only syncs between devices that are using the same version of the data model. 应该发生的是,iCloud数据仅在使用相同版本数据模型的设备之间同步。 If you upgrade the app on one device but not on a second device, they won't sync changes until the second device also updates to the new model version. 如果您在一台设备上而不是另一台设备上升级该应用程序,则他们将不会同步更改,直到另一台设备也更新到新型号。

If that's not what you're seeing, please add more details about the problem you're seeing. 如果这不是您看到的内容,请添加有关您遇到的问题的更多详细信息。

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

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