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

andreab35

macrumors 6502a
Original poster
May 29, 2008
825
0
USA
Hi guys!

Alright, I'm doing better bit by bit at this iPhone development thing! I'm still definitely learning, but I'm just playing around here for now with XCode, seeing what I can basically do.

Here's a line of code that is preventing me from running a simple little app I made for the heck of it and for playing around with.

(void) applicationDidFinishLaunching:(GSEventRef)event;

Right below that is that darn little failed x that says,
"Error: syntax error before 'void'.

Is there something wrong with that simple code above, or is the error referring to something else in my little app?

The code I pasted above does not have anything above it, besides:

#import "Take2Appdelegate.h"

#define MAX_FRAMES 45

That's it. These errors are occurring in the Classes .m file.

If you could help me out here, I'd really appreciate that! I've tried figuring it out myself, but I'm stumped.

Thank you!
 

walty

macrumors member
Jul 15, 2008
33
0
- (void) applicationDidFinishLaunching:(GSEventRef)event;


u need to add the minus sign to show it is a instance method (instead of class method)
 

andreab35

macrumors 6502a
Original poster
May 29, 2008
825
0
USA
- (void) applicationDidFinishLaunching:(GSEventRef)event;


u need to add the minus sign to show it is a instance method (instead of class method)

Thank you for your response.

I added the minus sign like you did above, and now I get the errors:

warning: declaration does not declare anything
error: syntax error before '-' token


Those are the only two errors I get throughout for the whole application.

But, if the minus sign is taken away, both those errors go away and the error that comes back again that I mentioned in my original post.
 

jnic

macrumors 6502a
Oct 24, 2008
567
0
Cambridge
That's it. These errors are occurring in the Classes .m file.

warning: declaration does not declare anything
error: syntax error before '-' token

Code:
- (void) applicationDidFinishLaunching:(GSEventRef)event {
	// Your code.
}

Maybe try a few tutorials first?
 

andreab35

macrumors 6502a
Original poster
May 29, 2008
825
0
USA
Code:
- (void) applicationDidFinishLaunching:(GSEventRef)event {
	// Your code.
}

Maybe try a few tutorials first?

*sigh*

I tried what you did, and I got the same error.
:(

But thanks for helping me. I appreciate your effort.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.