Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 10, 2009, 09:37 PM   #1
alexbates
macrumors 65816
 
alexbates's Avatar
 
Join Date: Nov 2008
Location: Georgia, USA
Error: expected ';' before '-' token

I finally finished coding an iPhone web browser but have gotten this error in Xcode in two different places. And the code the errors are referring to are....

Code:
#import "Basic_BrowseAppDelegate.h"
#import "Basic_BrowseViewController.h"
I don't think there is supposed to be a semicolon there buy I may be wrong.

Any ideas? (screenshots of errors are attached)

Thanks to all help! And sorry if this has already been asked or its a stupid question... I'm new to programming.
Attached Thumbnails
Click image for larger version

Name:	Picture 2.png
Views:	109
Size:	33.1 KB
ID:	175169  
Attached Images
 
__________________
2009 MacBook Pro 13"- 2.53GHz iPad 2 16GB Black iPhone 3GS 16GB Black
Macrumors Scavenger Hunt: 0 points
Twitter
alexbates is offline   0 Reply With Quote
Old Jun 10, 2009, 09:46 PM   #2
lucasgladding
macrumors 6502
 
Join Date: Feb 2007
Location: Waterloo, Ontario
 
You'll get used to these errors in the future. The problems are within your header files but are getting flagged during import in the implementation files. You may be able to spot the problem if you focus your attention there. If you have trouble finding the error, please post the source from those headers and someone should be able to help.

Hint: check your method declarations in the header for trailing semicolons.

Kind regards

Luke

BTW: you're correct - there is no semicolon after the import command
__________________
Lucas Gladding
Development/Interface Design/Illustration
www.cashdepositapp.com | www.ledgerapp.com
www.dribbble.com/lucasgladding
lucasgladding is offline   0 Reply With Quote
Old Jun 10, 2009, 09:55 PM   #3
alexbates
Thread Starter
macrumors 65816
 
alexbates's Avatar
 
Join Date: Nov 2008
Location: Georgia, USA
Quote:
Originally Posted by lucasgladding View Post
You'll get used to these errors in the future. The problems are within your header files but are getting flagged during import in the implementation files. You may be able to spot the problem if you focus your attention there. If you have trouble finding the error, please post the source from those headers and someone should be able to help.

Hint: check your method declarations in the header for trailing semicolons.

Kind regards

Luke

BTW: you're correct - there is no semicolon after the import command
Thanks for your reply. I think I have figured out the error. I was missing the semicolon after...

Code:
-(IBAction) gotoAddress:(id)sender;
in the ViewController.h file before...

Code:
@end
It will now build and go successfully...hooray!

Thanks again,
Alex
__________________
2009 MacBook Pro 13"- 2.53GHz iPad 2 16GB Black iPhone 3GS 16GB Black
Macrumors Scavenger Hunt: 0 points
Twitter
alexbates is offline   0 Reply With Quote
Old Jun 10, 2009, 11:36 PM   #4
HiRez
macrumors 601
 
HiRez's Avatar
 
Join Date: Jan 2004
Location: Western US
Just a general note, when you get errors near the beginning of a file, after you've checked what it's telling you, start looking for missing semicolons and missing or mis-matched braces. A lot of times the compiler will get really confused in these cases and the real error may be far away from where it's telling you it is, and the error it's reporting might not be the real problem either.
__________________
Go outside, the graphics are amazing!
HiRez is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Resolved: "Expected identifier" error when using C code moonman239 iPhone/iPad Programming 4 Jan 23, 2014 01:32 PM
Monopoly fans vote to add cat, toss iron token SilentPanda Current Events 14 Feb 6, 2013 02:58 PM
Push Notification: unable to get device token Narendar Singh iPhone/iPad Programming 1 Jul 20, 2012 08:26 AM

Forum Jump

All times are GMT -5. The time now is 02:48 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC