In iPhone development how to access a method in the ParentViewController
<p>I am a newbie iPhone Programmer and have a question regarding how to access methods of a Parent View Controller.
In my program when the program first loads (applicationDidFinishLaunching) I do the following code:</p>

<pre><code>[window addSubview:rootViewController.view];

[window makeKeyAndVisible];
</code></pre>

<p>which basically calls this</p>

<pre><code>- (void)viewDidLoad {

    HomeViewController *homeController=[[HomeViewController alloc] initWithNibName:@"HomeView" bundle:nil];
    self.homeViewController=homeController;
    [self.view insertSubview:homeController.view atIndex:0];
    [homeController release];
    [super viewDidLoad];
}
</code></pre>

<p>Now, I have an IBAction call on HomeViewController that I want to have it call a method in root View Controller</p>

<p>I want to call this method</p>

<pre><code>- (void)loadNewGame
{
    self.questionViewController = [[QuestionViewController alloc] initWithNibName:@"QuestionView" bundle:nil];
 //[homeViewController.view removeFromSuperview];    
    [self.view insertSubview:questionViewController.view atIndex:0];
}
</code></pre>

<p>So my question is how do I call a method from the Parent View controller?</p>

<p>I've tried</p>

<pre><code> [self.view removeFromSuperview];

 [self.parentViewController loadNewGame];
</code></pre>

<p>but that doesn't seem to work.  Could someone please ploint me in the right direction.</p>

<p>Thanks in advance</p>

<p>Scott</p>
