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

查看:683
本文介绍了找不到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:

Lexical或Preprocessor Issue 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 file。

如果我注释掉 #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...

帮助将很多赞赏!

推荐答案

我讨厌这个问题!似乎有一个简单的解决方案,SOMETIMES的工作原理:

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

转到构建阶段 - >链接带有Liibraries的Binary。

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")

请务必在此处阅读Matthew的答案...

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.

I希望它对某人有帮助!

I hope it helps someone!

这是一个令人愤怒的问题。在这种情况下,我刚刚再次发生这种情况,因为我随后从机器中删除了旧式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天全站免登陆