xcode 未找到 UIKit/UIKit.h 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26276200/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 05:49:25  来源:igfitidea点击:

UIKit/UIKit.h file not found

iosxcodexcode6

提问by Raghav

I have installed the Xcode 6.0.1and Xcode 5.1.1in my system. When I create project in Xcode 6.0.1it is working fine, when I create project in Xcode 5.1.1and build the same getting Proprocessor issue as UIKit/UIKit.h file not found.

我已经在我的系统中安装了Xcode 6.0.1Xcode 5.1.1。当我创建的项目Xcode 6.0.1它工作正常,当我创建项目Xcode 5.1.1,并建立同越来越Proprocessor问题作为UIKit/UIKit.h file not found

I tried to add the framework explicitly in Build phases and there also the UIKitis not found. Same for Foundation.frameworkalso.

我试图在构建阶段明确添加框架,但也UIKit没有找到。同为Foundation.framework也。

This issue is started once after installing the Xcode 6.

这个问题是安装后启动一次 Xcode 6.

Help appreciated.

帮助表示赞赏。

回答by Parth Patel p1nt0z

Add pch file in you in xcode project to resolve this very easily.

在 xcode 项目中添加 pch 文件可以很容易地解决这个问题。

  • Make new file: ?cmd+N

  • iOS/Mac > Other > PCH File > YourProject-Prefix.pch.

  • Project > Build Settings > Search: "Prefix Header".

  • Under "Apple LLVM 6.0" you will get the Prefix Header key.

  • Type in: "YourProjectName/YourProject-Prefix.pch".

  • Clean project: ?cmd+?shift+K

  • Build project: ?cmd+B add pch file

  • 新建文件:?cmd+N

  • iOS/Mac > 其他 > PCH 文件 > YourProject-Prefix.pch。

  • 项目 > 构建设置 > 搜索:“前缀标题”。

  • 在“Apple LLVM 6.0”下,您将获得 Prefix Header 键。

  • 输入:“YourProjectName/YourProject-Prefix.pch”。

  • 清理项目:?cmd+?shift+K

  • 构建项目:?cmd+B 添加pch文件

回答by sivi

Here is an answer that might help someone very new like me on the x-code ios ecosystem:

这是一个答案,可能会在 x-code ios 生态系统中帮助像我这样的新手:

for me the answer was to change back to ios form OS X in the build settings I really don't know why I changed it in the first place (probably because it told me to change from beta and i figured here I can change to something that is not beta not realizing entirely what I'm doing).

对我来说,答案是在构建设置中改回 ios 形式的 OS X 我真的不知道为什么我首先要更改它(可能是因为它告诉我从 beta 更改,我想在这里我可以更改为某些内容)这不是测试版没有完全意识到我在做什么)。

After that and

在那之后和

  • Deleting Xcode Beta and reinstalling Xcode (6.1 - current stable)

  • Updating the ios, version of my device (iphone 4s to 8.1.2 latest)

  • Changing signature in Code signing identity to an acceptable one (Provisioning Profile -Automatic)

  • 删除 Xcode Beta 并重新安装 Xcode(6.1 - 当前稳定)

  • 更新 ios,我的设备版本(iphone 4s 到最新的 8.1.2)

  • 将代码签名身份中的签名更改为可接受的签名(配置文件 - 自动)

Everything was going well, and I was able to submit the app via Xcode. P.s. maybe some of the heavy lifting of deleting wasn't necessary but it seemed to be the safest bet.

一切都很顺利,我能够通过 Xcode 提交应用程序。Ps 也许删除的一些繁重工作是不必要的,但它似乎是最安全的选择。