未找到 Availability.h、UIKit.h 等 [英] Availability.h, UIKit.h, etc not found

查看:20
本文介绍了未找到 Availability.h、UIKit.h 等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里遇到了很大的问题.

I'm having a great problem here.

我最近从 Mac App Store 下载了 Xcode 4.3,因为它具有 Lion 的全屏功能.然后,我的项目停止编译.它说:

I recently downloaded Xcode 4.3 from the Mac App Store, because it had the full-screen feature for Lion. And then, my project stopped compiling. It says:

词法或预处理器问题 Availability.h 文件未找到.

Lexical or Preprocessor Issue Availability.h file not found.

//
// Prefix header for all source files of the 'TRGame' target in the 'TRGame' project
//

#import <Availability.h>

#ifndef __IPHONE_3_0
#warning "This project uses features only available in iPhone SDK 3.0 and later."
#endif


#ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
#endif

xxxx-Prefix.pch 文件中.

如果我注释掉#import Availability.h,它会告诉我它找不到UIKit.h,依此类推...

If I comment out the #import Availability.h, it will tell me that it can't find the UIKit.h, and so on...

非常感谢您的帮助!

推荐答案

我讨厌这个问题!似乎有一个简单的解决方案,有时有效:

I hate this problem! There seems to be a simple solution that SOMETIMES works:

转到构建阶段 ->将二进制文件与库链接.

Go to Build Phases -> Link Binary With Liibraries.

如果您遇到问题,请说 Foundation.framework.只需删除那个 --- 即,使用列表底部的减号(-")按钮.

If you are having a problem with say Foundation.framework. Simply delete that one --- i.e., use the minus ("-") button at the bottom of the list.

然后再次添加,使用加号按钮.

And then add it again, using the plus button.

清理构建文件夹.(为此,请按住 ALT,然后单击产品"->清理".您将看到清理"更改为清理构建文件夹")

Clean the build folder. (To do so hold down ALT, then click Product -> Clean. You will see "Clean" changes to "Clean Build Folder")

一定要在这里阅读马修的回答......

Be sure to read Matthew's answer here ...

​​iOS SDK 从此崩溃重新安装未找到的 UIKit 和 Foundation 框架

查看您的框架搜索路径"的价值.

Look at the value of your "Framework Search Paths".

完全卸载 XCode 4.3,使用CleanMyMac";这样做(它会尝试找到您要删除的应用程序的每个相关组件).

Completely and totally uninstall XCode 4.3, use "CleanMyMac" to do so (it will try to find every associated component of the app you are trying to delete).

然后只需使用 App Store 来(重新)安装 XCode.正如大卫所说,这有时可以解决这个该死的问题.

Then just use the App Store to (re) install XCode. As David mentions, this can sometimes fix this damn problem.

我相信这个问题可能发生在您更换了硬盘驱动器(即,可能使用 Carbon Copy Cloner 等)或 Mac 上的主卷以某种方式在某些情况下被重命名或更改的情况下大大地.我认为新的应用程序样式"中可能存在一个小错误.Xcode 有时会,有时不会理解路径中的那种变化.

I believe this problem can possibly happen in situations where you have, say, replaced your hard drive (i.e., probably using Carbon Copy Cloner or the like) or in some way the main volume on your Mac gets renamed or changed in some way. I think there might be a slight bug in the new "application-style" Xcode where it sometimes does and sometimes does not understand that sort of change in the paths.

希望对大家有所帮助!

这是一个令人恼火的问题.在这种情况下,我刚刚再次发生这种情况,因为我随后删除了旧式"文件的副本.来自机器的 XCode.(在安装新式 XCode 之前,最好彻底删除旧式 XCode(/Developer 目录等).)

It is an infuriating problem. I just had it happen again, in this case, because I subsequently deleted a copy of the "old-style" XCode from a machine. (It's perhaps better to utterly delete old-style XCodes (/Developer directory, etc) before installing the new-style XCode.)

这篇关于未找到 Availability.h、UIKit.h 等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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