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

Hexero

macrumors regular
Original poster
Feb 2, 2010
124
0
Hi! I'm sure this is a common problem, but I couldn't find anything. I'm making a App for iPhone, when I'm trying to launch it in xCode the app I made won't start. It starts, then it closes. Is there a reason for this?

Thank you in advance!
 

zachsilvey

macrumors 6502
Feb 5, 2008
444
3
Battle Ground
You made a mistake in the code. Check the console to see if there are any messages. Also check xcode to see if there were any warnings at compile time.
 

Hexero

macrumors regular
Original poster
Feb 2, 2010
124
0
At compile time I get the error

"Expected '=', ',', ';', 'asm' or '__attribute__' before '-' token""

at the line

"- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {"
 
Last edited:

ulbador

macrumors 68000
Feb 11, 2010
1,554
0
At compile time I get the error

"Expected '=', ',', ';', 'asm' or '__attribute__' before '-' token""

at the line

"- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {"

There is nothing long with that line that I can see. Did you mess up a semicolon or something the line or two before that?
 

chown33

Moderator
Staff member
Aug 9, 2009
10,751
8,423
A sea of green
At compile time I get the error

"Expected '=', ',', ';', 'asm' or '__attribute__' before '-' token""

at the line

Code:
"- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {"

Post the code that comes before that line.

The error is complaining about the - in "- (BOOL)..etc.", and the most likely problem is that the line isn't in the right place, or something before it isn't terminated properly.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.