XCode6:接收错误“在框架模块内包括非模块化报头” [英] XCode6: Receiving error "Include of non-modular header inside framework module"
问题描述
我有一个iOS应用程式,由一个应用程式,一堆自订框架和一堆第三方framweorks组成:
App
MyFramework1
MyFramework2
AFNetworking.framework
Mantle.framework
..
我得到错误包括框架模块中的非模块化头,具有以下结构:
App / AppDelegate.m
#import< MyFramework2 / MyFramework2.h>
MyFramework2 / MyFramework2.h
#importMyClass.h
MyClass.h
#import< Mantle / Mantle.h> < - 错误发生在这里
MyFramework2自己创建 p>
尝试构建 App 失败,并在导入Mantle.h的行中包含错误在框架模块中包含非模块化头文件 。
如果我在 .m
文件中导入Mantle.h,但是我不能这是因为我的类继承自 MTLModel
,这是在Mantle中定义的。
此问题已解决
I have an iOS app that consists of an app, a bunch of my custom frameworks, and a bunch of third party framweorks:
App
MyFramework1
MyFramework2
AFNetworking.framework
Mantle.framework
..
I get the error "Include of non-modular header inside framework module" with the following structure:
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.
Trying to build App fails with the error "Include of non-modular header inside framework module" at the line that imports Mantle.h.
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.
This issue has been addressed here, but it isn't Swift-specific.
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
.
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.
Select the .h file in the project navigator. In the target membership area on the right there is a drop down menu next to the target. Select "public" there (probably "project" is selected right now).
这篇关于XCode6:接收错误“在框架模块内包括非模块化报头”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!