Xcode找不到头文件 [英] Xcode can't find header file

查看:1751
本文介绍了Xcode找不到头文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的项目制作一个框架。在我的框架中,我将头文件的路径添加到 target> Build Settings> header-search path 。之后我通过 Build Phases> Link Binary With Libraries 将这个框架添加到我的项目中。

I am trying to make a framework for my project. Into my framework I added the path of my header files to target>Build Settings>header-search path. After that I added this framework to my project by Build Phases>Link Binary With Libraries.

当我想导入头文件时我包含在我的框架中,我得到 .h文件未找到错误。我正在尝试做什么?或者我错过了什么?

When I want to import the header file which I included in my framework, I get a .h file not found error. Is what I'm trying to do possible? Or am I missing anything?

我创建了这样的框架;

I created framework like that;

打开新项目为iOS> Framework&库> Cocoa Touch Framework
我没有添加任何类,我只是添加了头搜索路径和库搜索路径和链接器标志。我不认为我在这部分中犯了一个错误,因为我们在每个项目中都这样做,但是第一次为框架做这个。然后我按下run并从Products获取我的框架。

Opened new project as iOS>Framework&Library>Cocoa Touch Framework I didn't add any class, i just added header search path and library search path and linker flags. I don't think i did a mistake in this part because we do it in every project but first time i m doing this for framework. Then i pressed run and get my framework from Products.

我打开了我的项目并添加了框架Build Phases> Link Binary With Libraries。我可以导入框架的头文件,如 #import< myframework / framework.h>
此后,我添加了框架General> Embedded Binaries。一切看起来都很正常,但我不能将标题添加到我的项目中,我将其包含在带有标题搜索路径的框架中。我必须使用标题搜索路径,因为有大量的标题,我不能将它们全部添加到我的Xcode。

I opened my project and added framework Build Phases>Link Binary With Libraries. I m able to import header file of framework like #import <myframework/framework.h> After this i added framework also General>Embedded Binaries. Everything look normal but i cannot add headers to my project which i included to my framework with header search path. I have to use header search path because there is tons of headers, i cannot add all of them to my Xcode.

推荐答案

制作确保所有Public Header出现在Public Section中,否则将.h文件拖放到公共

Make sure you all Public Header appears in Public Section else drag and drop .h file to public

这篇关于Xcode找不到头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆