在编译管理对象模型时忽略丢失反向警告的任何方式? [英] Any way to ignore missing inverse warnings when compiling a managed object model?

查看:104
本文介绍了在编译管理对象模型时忽略丢失反向警告的任何方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题几乎包含了问题。我们发布了一个应用程序,其数据模型的反转配置不正确。我们在下一个版本中修复了这些数据模型的新版本,但Xcode在编译以前的数据模型版本时仍显示警告。

The title pretty much contains the question. We released an app with a data model that had their inverses improperly configured. We fixed these in the next release with a new version of the data model, but Xcode still displays the warnings when compiling the previous data model version.

我不想想要打破将文档从旧数据模型迁移到新数据模型的能力,而且我确信在旧数据模型中更改倒数将会做到这一点。所以,我想知道是否有一种方法来抑制那个文件的警告 - 我担心别人可能会来,看到警告,并决定修复。

I don't want want to break the ability to migrate documents from the old data model to the new data model and I'm pretty sure that changing the inverses in the old data model will do just that. So, I'm wondering if there's a way to suppress that warning for just that file - I'm concerned somebody else might come along, see the warning, and decide to "fix" it.

编辑:基于pe8ter的注释,看起来我想为数据模型的单个修订版本指定MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS选项。我不想把它关闭项目范围甚至模型捆绑,因为我想要警告出现,如果人们在以后犯同样的错误。

Based on pe8ter's comments, it looks like I want to specify the MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS option for a single revision of the data model. I don't want to turn it off project-wide or even model bundle-wide because I want the warnings to appear if people make this same mistake in the future.

推荐答案

因为你只包括文件的向后兼容性,因此你不希望它改变,我建议检查已编译的文件到源代码控制和使用复制文件建立阶段将它放在正确的位置。

Since you're only including the file for backwards compatibility, and therefore you don't want it to ever change, I would recommend checking the already compiled file into source control and using a Copy Files build phase to put it in the correct place.

因为我们只是在一个bundle中的一个修订版本,你可能需要保留一个空的虚拟版本模型源(所以它获得编号权限)。然后,您的复制文件阶段将覆盖它。

Since we're just talking about a single revision in a bundle, you might need to keep an empty, dummy version in the model source (so it gets the numbering right). Then your Copy Files phase would just overwrite it.

这篇关于在编译管理对象模型时忽略丢失反向警告的任何方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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