Trouble in XCode-Expected declaration or statement at end of input
Im a starting to learn to develop iOS apps, and i have this codes, and it appear that it has a problem.... Please HELP!!!
#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
@implementation UntitledViewController
@synthesize webView, adressBar, activityIndicator;
-(void)viewDidLoad {
[super viewDidLoad];
NSString *urlAdress = @"google.com";
NSURL *url = [NSURL URLWithString:urlAdress];
NSURLRequest *request0bj = [NSURLRequest requestWithURL:url];
[webview loadRequest:request0bj];
[adressBar serText:urlAdress];
}
-(IBAction)gotoAdress:(id) sender {
NSURL *url = [[NSURL URLWithString:[adressBar text]];
NSURLRequest *request0bj = [NSURLRequest requestWithURL:url];
//Load the request in the UIWebview.
[webView loadRequest:request0bj];
[adressBar resignFirstResponder];
}
-(IBAction)goBack:(id)sender {
[webView goBack];
}
-(IBAction) goForward:(id)sender {
[webView goForward];
}
- (void)WebviewDidStartLoad:(UIWebView *)webView {
[activityIndicator startAnimating];
}
-(void)webViewdidFinishLoad:(UIWebView *)webView {
[activityIndicator stopAnimating];
}
- (BOOL)webView:(UIWebView*)webView shouldStartLoadingWithRequest:(NSURLRequest*)reque st
navigationType:(UIWebViewNavigationType)navigation Type {
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
NSURL *URL = [request URL];
if ([[URL scheme] isEqualToString:@"http"]) {
[adressBar setText:[URL absoluteString]];
[self gotoAdress:nil];
}
return NO;
}
return YES;
}
@end