Link to home
Create AccountLog in
Avatar of Michael Sole
Michael Sole

asked on

Simple Objective C help

I am creating a very simple webView app by following a tutorial. For some reason I can not get my action goToHome to show up when I try to assign it to a button in the xib. Here are the .h and .m files:

.h
//
//  ViewController.h
//  Premiere Orlando
//
//  Created by Michael Sole on 11/2/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController {
    IBOutlet UIWebView *webView;
    IBOutlet UIActivityIndicatorView *activityView;
}

@property (nonatomic, retain) IBOutlet UIWebView *webView;
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *activityView;

-(IBAction)goforward:(id)sender;
-(IBAction)goback:(id)sender;
-(IBAction)goToHome:(id)sender;

@end

Open in new window

.m:
//
//  ViewController.m
//  Premiere Orlando
//
//  Created by Michael Sole on 11/2/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import "ViewController.h"

@implementation ViewController

@synthesize webView,activityView;

-(IBAction)goforward:(id)sender{
    
    [webView goForward];
}
-(IBAction)goback:(id)sender{
    
    [webView goBack];
    
}
-(IBAction)goToHome:(id)sender{
    
    NSString *myURL = @"http://premierorlando.mobi/index.php";
    NSURL *url = [NSURL URLWithString:myURL];
    NSURLRequest *myRequest = [NSURLRequest requestWithURL:url];
    [webView loadRequest:myRequest];
    
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
	[super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
	[super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    } else {
        return YES;
    }
}

@end

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of SpeedyApocalypse
SpeedyApocalypse
Flag of Canada image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account