找不到迁移的映射模型,映射模型必须去哪里? [英] Can't find mapping model for migration, where does the mapping model have to go?

查看:107
本文介绍了找不到迁移的映射模型,映射模型必须去哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在iOS上使用CoreData的项目,我们使用轻量级迁移技术和NSInferMappingModelAutomaticallyOption设置为YES进行了大量模型更新。这个工作完全正常,但对于当前的转换,我们需要指定一些更多的信息,从而创建一个映射模型。

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.

我创建了mapper通过去File-> New并创建一个新的数据模型映射器,将我的模型的旧版本映射到新版本。映射器位于项目的资源文件夹中。在做任何自定义之前,我想检查模型是否工作,并在创建persistentStoreCoordinator时从选项字典中删除NSInferMappingModelAutomaticallyOption。但是,现在我得到一个错误,找不到映射模型迁移,即使我可以看到编译的映射器捆绑的应用程序。

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.

其中我必须把数据模型映射器,如它是自动找到的?我使用XCode 4.0

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

推荐答案

原来的答案很简单:从XCode 4.0升级到(至少)XCode 4.0.2它的工作原理像一个魅力。必须是XCode版本中的错误。

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.

这篇关于找不到迁移的映射模型,映射模型必须去哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆