简体   繁体   English

XCode中更改为映射模型的更改未在模拟器捆绑包中更新

[英]Changed in XCode to mapping model aren't updated in simulator bundle

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文件的大小也未更改。

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). 在这种情况下,捆绑软件中的.cdm文件存在,但非常小-小于0.5k(我的工作文件为〜14k)。

I've tried running "Clean", emptying Xcode's DerivedData directory and resetting the simulator. 我尝试运行“清理”,清空Xcode的DerivedData目录并重置模拟器。 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. 进行全部清理(在从菜单中选择“清理”的同时按住Option键)将删除派生的数据,并允许提取映射模型中的更改。

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. 出于习惯,在处理Xcode内部的任何文件(不是专门的源代码文件)时,我总是清理所有内容。

I would also suggest filing a radar. 我也建议提起雷达。 This has been an issue since mapping models came out in Leopard. 自从Leopard中的映射模型问世以来,这一直是一个问题。

It is not an issue with the Simulator but an issue with Xcode not watching for those files to change. 这不是模拟器的问题,而是Xcode不监视那些文件更改的问题。 Once the compiled copies are removed (via the clean all), Xcode will copy over the entire app bundle to the sim again. 一旦删除了已编译的副本(通过全部清除),Xcode就会将整个应用程序捆绑包再次复制到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. 但是,当您测试迁移时,我发现无论如何都要“重置” SIM卡很有帮助,通常对没有映射模型或要迁移到的新模型的副本不利。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM