Core Data Migration - Can't find mapping model for migration

杀马特。学长 韩版系。学妹 提交于 2019-11-30 09:10:21

Turns out the Mapping Model needs to be part of the .xcdatamodeld package, which is impossible to do within xcode 4. With it in there, it works great.

Note: my mapping file stopped working again, and I found that it was 0KB on disc, so I had to recreate it again and it worked fine after that. I quickly committed it and will see if it disappears again. The problem is that Xcode 4 indexes it or something so it looks fine in xcode but on the file system its empty.

See my comment below for the reason (xcode 4's mapc (map compiler) is broken).

** THIS HAS BEEN FIXED IN THE NEWER XCODEs/SDKs.**

sippndipp

I had a similar problem:

Custom Policy in my xcmappingmodel will not be executed

in my case it was not executed since my migration did not do any changes to the tables - maybe this is your problem too.

Make sure to set up the source data model as your OLD version, and the destination as the new one... I have gotten the error above when these were backwards.

you need to create a new version of the schema, as opposed to changing the current version. presuming you have done this, what changes have been made to the model? some changes are too drastic to be inferred reliably.

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