gpt4 book ai didi

XCode6:接收错误 "Include of non-modular header inside framework module"

转载 作者:行者123 更新时间:2023-12-03 22:23:14 26 4
gpt4 key购买 nike

我有一个 iOS 应用程序,它由一个应用程序、一堆我的自定义框架和一堆第三方框架组成:

App
MyFramework1
MyFramework2
AFNetworking.framework
Mantle.framework
..

我收到错误“在框架模块中包含非模块化 header ”,其结构如下:
App/AppDelegate.m
#import <MyFramework2/MyFramework2.h>

MyFramework2/MyFramework2.h
#import "MyClass.h"

MyClass.h
#import <Mantle/Mantle.h> <-- Error happens here

MyFramework2 构建 单独 .

正在尝试构建 应用 在导入 Mantle.h 的行中出现错误“Include of non-modular header inside framework module”失败。

如果我在 .m 中导入 Mantle.h,这个问题就会消失。文件,但我不能这样做,因为我的类继承自 MTLModel ,在 Mantle 中定义。

此问题已解决 here ,但它不是 Swift 特有的。

建议 (1) 确保所有自定义框架 header 都是公开的。他们是。并且 (2) 转到“目标”下的build设置并将“允许框架模块中的非模块化包含”设置为 YES .

有谁知道为什么会发生这种情况以及如何解决?将“允许框架模块中的非模块化包含”设置为"is"是否被认为是一种好习惯?为什么这是一个错误?

谢谢。

最佳答案

在项目导航器中选择 .h 文件。在右侧的目标成员(member)区域中,目标旁边有一个下拉菜单。在那里选择“public”(现在可能选择了“project”)。

enter image description here

关于XCode6:接收错误 "Include of non-modular header inside framework module",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28552500/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com