且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Xcode 4.2中禁用CoreData的反向关系警告?

更新时间:2022-10-26 19:14:42

使用XCode 4.3:



查找构建设置的方式


  1. 选择项目节点)

  2. 设置标签

查找并设置MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS设置


  1. 将构建设置向下滚动到底部附近,找到名为数据模型版本编译器(MOMC)警告的部分


  2. 第一个条目是MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS,默认为NO


  3. 将其更改为YES

    $ b

重新生成,警告应该消失。


There was a MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS setting on Xcode 3 but I cannot find it in Xcode 4.2 and trying to set it as a user defined build setting have no effect.

I know why I should use inverse relationship but I just don't want it for various reasons.

Using XCode 4.3:

Find your way to Build Settings

  1. Select project node (top node) in the project Navigator

  2. Select your project under Targets

  3. Select the "Build Settings" tab

Find and set the MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS setting

  1. Scroll all the way down the build settings to near the bottom and find the section named "Data Model Version Compiler (MOMC) Warnings"

  2. The first entry is "MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS" and it defaults to NO

  3. Change it to YES

Build again, and the warnings should vanish.