编译Prefix.pch文件时出错,导致更大的问题
更新 2
我发现,如果我将“Base SDK”更改为“iOS Simulator 3.2”(iPad ???),则在进行“构建和更新”时不会出现此错误。分析一下...但这应该是一个iPhone应用程序。我正在运行 XCode 3.2.4...创建项目时是否缺少某些内容?我选择 iPhone 作为目标设备,不确定发生了什么。
原始
我在发现 iPhone 应用程序内存泄漏时遇到问题。我尝试运行“构建和分析”,但当它到达 MyApp_Prefix.pch 文件时,它显示“分析器由于解析错误而跳过了此文件” - 然后 50% 的文件显示“由于解析而跳过了此文件”错误 - /var/folders/ ... /MyApp_Prefix.pch 文件未找到”。
App实际编译运行,Prefix.pch文件确实存在。
当我打开第一个错误下出现的所有错误时,它开始打开框架中的文件,我不知道为什么其中会出现问题。
以下是 .pch 文件的内容:
//
// Prefix header for all source files of the 'Tickets' target in the 'Tickets' project
//
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif
更新 以下是当我单击“函数声明符后的预期函数体”、“预期类型”等时打开的文件... CGPDFContext.h UIView.h UIApplication.h UITextView.h UIWebView.h
这些都位于框架中。
我尝试创建一个全新的项目并导入现有的类,但它给了我同样的错误。
我尝试运行 Build &分析我的一个旧项目,它使用相同的框架,并且运行良好。
Update 2
I discovered that if I change the "Base SDK" to "iOS Simulator 3.2" (iPad ???) it does not give me this error when doing Build & Analyze... But this is supposed to be an iPhone App. I am running XCode 3.2.4... am I missing something when I create the Project? I am choosing iPhone as the target device, not sure what's going on.
Original
I am having problems finding a memory leak in my iPhone App. I tried running "Build & Analyze", but when it gets to the MyApp_Prefix.pch file, it says "Analyzer skipped this file due to parse errors" - then 50% of the files after that say "Skipped this file due to parse errors - /var/folders/ ... /MyApp_Prefix.pch file not found".
The App actually compiles and runs, and the Prefix.pch file does exist.
When I open all the errors that appear under the first error, it starts opening files that are in the frameworks, which I don't know why there would be something wrong in there.
Here is the contents of the .pch file:
//
// Prefix header for all source files of the 'Tickets' target in the 'Tickets' project
//
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif
UPDATE
Here are the files that open when I click the 'expected function body after function declarator', 'expected type', etc...
CGPDFContext.h
UIView.h
UIApplication.h
UITextView.h
UIWebView.h
These are all located in the Frameworks.
I tried creating an entirely new project and importing my existing classes, and it gave me the same errors.
I tried running Build & Analyze on one of my older projects, which use the same Frameworks, and it runs fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我刚刚遇到了完全相同的问题。我从模拟器切换到设备并再次运行“构建和分析”,你瞧,它起作用了。不要问我为什么,但这至少使您能够使用分析功能。
I just had the exact same problem. I switched from simulator to device and ran "Build & Analyze" again, and lo and behold, it worked. Don't ask me why, but at least this enables you to use the analyze feature.
我用以下内容修复了我的构建 - 当前版本的 XCode 中似乎存在错误,因此该标志未正确设置:
I fixed my build with the following - there seems to be a bug in the current version of XCode so the flag isn't set properly:
您可以查看 .pch 文件,它实际上是一个包含/导入的文本文件。也许里面有一些垃圾。
You can take a peek in the .pch file, its actually a text file with includes/imports. Maybe there is some garbage in there.