How to disable no inverse relationship warning for

2019-01-08 21:50发布

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.

3条回答
孤傲高冷的网名
2楼-- · 2019-01-08 22:02

The setting is still there in Xcode 4. At least it is for me when I create a new project in Xcode 4.2 that uses Core Data. The MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS setting is in the Data Model Version Compiler (MOMC) Warnings collection, which is towards the bottom of the build settings list.

查看更多
混吃等死
3楼-- · 2019-01-08 22:09

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.

查看更多
地球回转人心会变
4楼-- · 2019-01-08 22:20

In XCode 5, 6 and 7, you can still set the variable.

  1. Navigate to Build Settings

    A. Select your project on the left side bar under Project Navigator.

    B. Select the "Build Settings" tab.

  2. Find and set MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS

    A. Select 'All' in the upper left of the main screen.

    B. Search for MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS by pasting the key into the search bar.

    C. Change value to YES.

Build again and the warnings are gone.

****EDIT****

Thanks @RajTandel for the comment. If you still see the warnings, restart Xcode and the warnings should go away.

查看更多
登录 后发表回答