Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hssky97

macrumors regular
Original poster
Jan 20, 2010
108
0
Hey everyone, I have been programming in Xcode for a couple months now. I have been making a few apps to test out, I started one today and it told me that their was 7235 errors! I looked over my code their was no errors on my part, then I clicked the error log and it looked like the ENTIRE foundation.framework was messed up! Here's an example; FOUNDATION_EXPORT NSUInteger NSRoundUpToMultipleOfPageSize(NSUInteger bytes); Expected '=' ,' . ' ' ; ' ,' 'asm' or '_attribute_' before 'NSUInteger'. So, basically it's that times 7235. So what should I do.....re-install foundation.framework or what?
 

xStep

macrumors 68020
Jan 28, 2003
2,031
143
Less lost in L.A.
I would first confirm if this affects your past apps. If not, then trying to reinstall the framework doesn't make sense. It would also confirm your source just an an issue.

I don't even know if there is a way to reinstall just a framework. Perhaps you'd have to reinstall all of Xcode.
 

RonC

macrumors regular
Oct 18, 2007
108
0
Chicago-area
Are all of these errors in one file?
Are all of these errors in files that share a header file that you created?

It smells like there's an extraneous character in one of your files, hiding in front of a #import statement, that's causing the preprocessor to barf on the foundation header file.

Before you go about reinstalling Xcode only to find that the problem is still there, post a little bit of the code here and let some fresh eyes take a quick peek.

Ron
 

hssky97

macrumors regular
Original poster
Jan 20, 2010
108
0
I would first confirm if this affects your past apps. If not, then trying to reinstall the framework doesn't make sense. It would also confirm your source just an an issue.

I don't even know if there is a way to reinstall just a framework. Perhaps you'd have to reinstall all of Xcode.

It doesn't affect my previous apps....hmmm. So I don't think I would need to re-install anything. :confused:
 

hssky97

macrumors regular
Original poster
Jan 20, 2010
108
0
Are all of these errors in one file?
Are all of these errors in files that share a header file that you created?

It smells like there's an extraneous character in one of your files, hiding in front of a #import statement, that's causing the preprocessor to barf on the foundation header file.

Before you go about reinstalling Xcode only to find that the problem is still there, post a little bit of the code here and let some fresh eyes take a quick peek.

Ron

I have no idea what is going on! All of my previous apps work... it the pch. file that I think is creating the problem....I just don't know how to solve it??
I'll take some screenshots then post them here afterwords.
 

hssky97

macrumors regular
Original poster
Jan 20, 2010
108
0
Photos

.pch file

screen-shot-2011-05-26-at-5-23-09-pm.png


Errors
screen-shot-2011-05-26-at-5-21-20-pm.png


screen-shot-2011-05-26-at-5-22-54-pm.png


screen-shot-2011-05-26-at-5-22-36-pm.png


screen-shot-2011-05-26-at-5-22-05-pm.png
 

chown33

Moderator
Staff member
Aug 9, 2009
10,751
8,423
A sea of green
Look at the error right before one of the Expected '='... errors, in the 3rd screenshot, I think.
It says Invalid preprocessing directive #indef.

Fix your spelling. I can't tell whether it should be #ifdef or #ifndef, but definitely not #indef.
 

xStep

macrumors 68020
Jan 28, 2003
2,031
143
Less lost in L.A.
.pch file

If your other apps are not having this problem, then the problem is specific to your new apps source code. Now that you've shown us how the errors report on Apples include files, show us your source and any errors report on it. I think specifically the includes, imports, and @interface & @implementation lines. More broadly, the interface .h files and the source of the implementation file from the top down to and include the @implementation line.

My suspicion (wild guess) is that you have some rouge character between the top of a source file and down to a @interface & @implementation line. Maybe even you @interface & @implementation lines are not correctly formatted.

EDIT: I see chown33 has a very sharp eye.
 

hssky97

macrumors regular
Original poster
Jan 20, 2010
108
0
Look at the error right before one of the Expected '='... errors, in the 3rd screenshot, I think.
It says Invalid preprocessing directive #indef.

Fix your spelling. I can't tell whether it should be #ifdef or #ifndef, but definitely not #indef.


Not Workin' :(
 

hssky97

macrumors regular
Original poster
Jan 20, 2010
108
0
Good news.....and bad news

As I have said previously it was the .pch file that was causing the problem.... so I deleted it from the project to see what would happen.
The Good News:D the +7,000 errors went away! The code for the .pch file matches the code from previous apps line-by-line so why would it not work on new projects I'm starting? The Bad News:mad: I need that file for the app to function and I received only one error that looked like this;

Command/Volumes/Developer/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

Soooo....how do I fix?????
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.