在XCode中更改为映射模型不会在模拟器包中更新 [英] Changed in XCode to mapping model aren't updated in simulator bundle

查看:235
本文介绍了在XCode中更改为映射模型不会在模拟器包中更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个在两个核心数据模型之间迁移的映射模型。然后我编辑了我的映射模型,(添加了自定义迁移策略,更改了映射名称等),运行模拟器,没有什么改变。加载了旧的映射模型,忽略了我的更改。查看模拟器运行的包,.cdm文件的大小也没有改变。

I created a mapping model to migrate between two core data models. I then edited my mapping model, (added a custom migration policy, changed a mapping name, etc.), ran the simulator, and... nothing changed. The old mapping model was loaded, ignoring my changes. Looking into the bundle that the simulator runs, the size of the .cdm file didn't change as well.

另一个奇怪的问题是,有时映射模型可以'甚至发现,导致迁移误差。在这种情况下,捆绑包中的.cdm文件存在,但非常小 - 小于0.5k(我的工作文件是〜14k)。

Another strange problem is that sometimes the the mapping model can't even be found, resulting in a migration error. In this case, the .cdm file in the bundle exists but is very small - less than 0.5k (my working file is ~14k).

清理,清空Xcode的DerivedData目录并重置模拟器。他们只是为新的映射模型解决问题,但编辑它们将不再工作。这使得它几乎不可能使用映射模型。非常令人沮丧: - (

I've tried running "Clean", emptying Xcode's DerivedData directory and resetting the simulator. They solve the problem only for new mapping models, but editing them will again not work. This makes it virtually impossible to work with mapping models. Very frustrating :-(

推荐答案

执行全部清除(从菜单中选择清除时按住选项键)导出的数据,并允许映射模型中的变化被拾起。

Doing a clean all (holding down the option key while selecting clean from the menu) will remove the derived data and will allow the changes in the mapping model to be picked up.

出于习惯,我总是做一个干净的当我使用任何文件

Out of habit, I always do a clean all when I am working with any files inside of Xcode that are not specifically source code files.

我也建议写一个雷达。这是一个问题,因为映射模型出现在Leopard。

I would also suggest filing a radar. This has been an issue since mapping models came out in Leopard.

这不是模拟器的问题,但是Xcode没有看到这些文件要改变的问题。一旦编译的副本被删除(通过全部清除),Xcode将复制整个

It is not an issue with the Simulator but an issue with Xcode not watching for those files to change. Once the compiled copies are removed (via the clean all), Xcode will copy over the entire app bundle to the sim again.

但是,当你测试一个迁移,我发现它有助于重置sim反正,通常不好的副本,没有要迁移到的映射模型或新模型。

However, when you are testing a migration, I find it helpful to "reset" the sim anyway, usually bad to a copy that didn't have the mapping model or the new model that you are migrating to.

这篇关于在XCode中更改为映射模型不会在模拟器包中更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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