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,开发者_Go百科 and it runs fine.
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.
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:
#ifdef __OBJC__
#ifndef __IPHONE_OS_VERSION_MIN_REQUIRED
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_3_0
#endif
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif
You can take a peek in the .pch file, its actually a text file with includes/imports. Maybe there is some garbage in there.
精彩评论