轻量级迁移完成通知 [英] Lightweight migration completed notification
问题描述
我已经成功地使用轻量级迁移的几个版本,但在我最新的版本,我需要加载一些在迁移过程中创建的表与迁移完成后的数据。我想象的是,当我的初始 UIViewController
调用该方法加载数据到新的表,可能是迁移尚未完成,应用程序将崩溃,因此:
I've been using lightweight migration for several versions successfully, but in my newest version I need to load some tables that are created during the migration with data after the migration completes. I imagine it's possible that when my initial UIViewController
calls the method to load data into the new tables, the migration hasn't completed and the app will crash, so:
如何确定轻量级迁移已完成?
推荐答案
当您使用相应的选项调用 addPersistentStoreWithType:...
时,会发生自动轻量级迁移,并在调用返回时完成。
在后台没有异步迁移。
The automatic lightweight migration happens when you call addPersistentStoreWithType:...
with the corresponding options, and is completed when that call returns.
There is no asynchronous migration in the background.
这篇关于轻量级迁移完成通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!