如何在 Xcode 4.2 中禁用 CoreData 的无逆关系警告?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8221813/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to disable no inverse relationship warning for CoreData in Xcode 4.2?
提问by Bryan Chen
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.
Xcode 3 上有一个 MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS 设置,但我在 Xcode 4.2 中找不到它,并试图将其设置为用户定义的构建设置无效。
I know why I should use inverse relationship but I just don't want it for various reasons.
我知道为什么我应该使用逆关系,但我只是出于各种原因不想要它。
回答by mikeho
In XCode5, 6and 7, you can still set the variable.
在XCode 5、6和7 中,您仍然可以设置变量。
Navigate to Build Settings
A. Select your project on the left side bar under Project Navigator.
B. Select the "Build Settings" tab.
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.
导航到构建设置
A. 在项目导航器下的左侧栏上选择您的项目。
B. 选择“构建设置”选项卡。
查找并设置
MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS
A. 选择主屏幕左上角的“全部”。
B.
MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS
通过将密钥粘贴到搜索栏中进行搜索。C. 将值更改为 YES。
Build again and the warnings are gone.
再次构建,警告消失了。
****EDIT****
****编辑****
Thanks @RajTandel for the comment. If you still see the warnings, restart Xcodeand the warnings should go away.
感谢@RajTandel 的评论。如果您仍然看到警告,请重新启动Xcode,警告应该会消失。
回答by Rhubarb
Using XCode 4.3:
使用 XCode 4.3:
Find your way to Build Settings
找到构建设置的方法
Select project node (top node) in the project Navigator
Select your project under Targets
Select the "Build Settings" tab
在项目导航器中选择项目节点(顶部节点)
在目标下选择您的项目
选择“构建设置”选项卡
Find and set the MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS setting
查找并设置 MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS 设置
Scroll all the way down the build settings to near the bottom and find the section named "Data Model Version Compiler (MOMC) Warnings"
The first entry is "MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS" and it defaults to NO
Change it to YES
将构建设置一直向下滚动到底部附近,找到名为“数据模型版本编译器 (MOMC) 警告”的部分
第一个条目是“MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS”,默认为 NO
将其更改为是
Build again, and the warnings should vanish.
再次构建,警告应该消失。
回答by Mark Szymczyk
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.
该设置在 Xcode 4 中仍然存在。至少当我在 Xcode 4.2 中创建一个使用 Core Data 的新项目时,它对我来说是这样。MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS 设置位于数据模型版本编译器 (MOMC) 警告集合中,位于构建设置列表的底部。