title: Call Void on First View Controller from Second View Controller in Xcode
body: <p>I am using Xcode 4.6.2 and have created a new Tabbed Application using apples template. I have placed a UIWebView on my First View Controller and loaded <a href="http://google.co.uk" rel="nofollow noreferrer">http://google.co.uk</a> into it. On my Second View Controller I have created a button that, when pressed, will load <a href="http://google.co.uk/images" rel="nofollow noreferrer">http://google.co.uk/images</a> into the Web View on the first controller. It is this bit I am stuck on, here is my code so far:  </p>
  
  <p><strong>FirstViewController.h</strong>  </p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;  
  
  @interface FirstViewController : UIViewController {  
      IBOutlet UIWebView *mainWebView;  
  }  
  
  -(void)imagesURL;  
  
  @end
  </code></pre>
  
  <p><strong>FirstViewController.m</strong>    </p>
  
  <pre><code>#import "FirstViewController.h"
  
  @interface FirstViewController ()
  
  @end
  
  @implementation FirstViewController
  
  - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  {
      self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
      if (self) {
          self.title = NSLocalizedString(@"First", @"First");
          self.tabBarItem.image = [UIImage imageNamed:@"first"];
      }
      return self;
  }
  
  - (void)viewDidLoad
  {
      [mainWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://google.co.uk"]]];
  
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
  }
  
  - (void)imagesURL {
      [mainWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://google.co.uk/images"]]];
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  @end
  </code></pre>
  
  <p><strong>SecondViewController.h</strong></p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import "FirstViewController.h"
  
  @interface SecondViewController : UIViewController {
  
  }
  
  - (IBAction)imagesButton:(id)sender;
  
  @end
  </code></pre>
  
  <p><strong>SecondViewController.m</strong></p>
  
  <pre><code>#import "SecondViewController.h"
  #import "FirstViewController.h"
  
  @interface SecondViewController ()
  
  @end
  
  @implementation SecondViewController
  
  - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  {
      self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
      if (self) {
          self.title = NSLocalizedString(@"Second", @"Second");
          self.tabBarItem.image = [UIImage imageNamed:@"second"];
      }
      return self;
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  - (IBAction)imagesButton:(id)sender {
      FirstViewController *view1 = [[FirstViewController alloc] init];
      [view1 imagesURL];
  }
  @end
  </code></pre>
  
  <p>At the moment, when I press the Images button on the Second View Controller and switch back to the first, nothing happens at all. The webpage doesn't load. its like the Void isn't being called. What am I doing wrong?</p>