Multiple Pass Core Data Migration In Chunks With iOS

本小妞迷上赌 提交于 2019-11-29 07:22:45

问题


I'm trying to migrate an iPhone/iPad sqlite store of about 11Mb. It has around thirty different entities, all quite heavily interrelated.

On a 3GS, it takes quite some time. Even a lightweight migration takes around four minutes.

I guess this is because all the relationships are held in memory.

Reading the Apple migration guide, it says that for large datasets, one approach is to do multiple passes using different mapping models.

All well and good. However, it seems that you can't do this if the entities in one mapping model are related to those in another. In fact, a compilation error is generated along the lines of "can't auto generate value expression with nil mapping name" in the Mapping Model xcmappingmodel file.

Any tips much appreciated.

Many thanks,

Max


回答1:


Cant you just create a new database with the new scheema and then start the migration process by reading from the old one and inserting to the new one ?



来源:https://stackoverflow.com/questions/4451951/multiple-pass-core-data-migration-in-chunks-with-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!