Can't find mapping model for migration, where does the mapping model have to go?

非 Y 不嫁゛ 提交于 2019-12-10 17:49:07

问题


I have a project that uses CoreData on iOS and we have gone through numerous model updates with the lightweight migration technique and the NSInferMappingModelAutomaticallyOption set to YES. This works perfectly fine, but for the current transition we need to specify some more information and thus create a mapping model.

I created the mapper by going to File->New and create a new data model mapper that maps the old version of my model to the new version. The mapper is in the Resources folder in the project. Before doing any customization I wanted to check whether the model works and removed the NSInferMappingModelAutomaticallyOption from the options Dictionary when creating the persistentStoreCoordinator. However, now I get an error that says "Can't find mapping model for migration" even though I can see that the compiled mapper is bundled with the app.

Where do I have to put the data model mapper such as that it is found automatically? I use XCode 4.0


回答1:


Turns out the answer is very simple: Upgrade from XCode 4.0 to (at least) XCode 4.0.2 and it works like a charm. Must be a bug in the XCode version.



来源:https://stackoverflow.com/questions/6783197/cant-find-mapping-model-for-migration-where-does-the-mapping-model-have-to-go

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