xcode XCode6:接收错误“在框架模块中包含非模块化标头”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28552500/
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
XCode6: Receiving error "Include of non-modular header inside framework module"
提问by bcattle
I have an iOS app that consists of an app, a bunch of my custom frameworks, and a bunch of third party framweorks:
我有一个 iOS 应用程序,它由一个应用程序、一堆我的自定义框架和一堆第三方框架组成:
App
MyFramework1
MyFramework2
AFNetworking.framework
Mantle.framework
..
I get the error "Include of non-modular header inside framework module" with the following structure:
我收到错误“Include of non-modular header inside framework module”,结构如下:
App/AppDelegate.m
#import <MyFramework2/MyFramework2.h>
MyFramework2/MyFramework2.h
#import "MyClass.h"
MyClass.h
#import <Mantle/Mantle.h> <-- Error happens here
MyFramework2 builds by itself.
MyFramework2建立本身。
Trying to build Appfails with the error "Include of non-modular header inside framework module" at the line that imports Mantle.h.
尝试构建App失败,在导入 Mantle.h 的行中出现错误“Include of non-modular header inside framework module” 。
This issue goes away if I import Mantle.h in the .m
file, but I can't do that because my class inherits from MTLModel
, which is defined in Mantle.
如果我在.m
文件中导入 Mantle.h,这个问题就会消失,但我不能这样做,因为我的类继承自MTLModel
Mantle 中定义的 。
This issue has been addressed here, but it isn't Swift-specific.
此问题已在此处解决,但并非特定于 Swift。
Suggestions there are (1) make sure all custom framework headers are public. They are. And (2) go to Build Settings under "Target" and set "Allow Non-modular Includes in Framework Modules" to YES
.
建议有 (1) 确保所有自定义框架标头都是公开的。他们是。(2) 转到“目标”下的“构建设置”并将“允许非模块化包含在框架模块中”设置为YES
.
Does anyone know why this is happening and how to fix it? Is setting "Allow Non-modular Includes in Framework Modules" to YES considered a good practice? Why is this an error?
有谁知道为什么会发生这种情况以及如何解决?将“允许非模块化包含在框架模块中”设置为“是”是否被认为是一种好习惯?为什么这是一个错误?
Thanks.
谢谢。