IPHONE - Use multiple views
<p>I have to make an application with six views, which can be accessed to by bar button items on a toolbar. </p>

<p>I'm really new at this.
I have a view controller and a XIB file for each view, with six functions (goToView1, goToView2, ..., goToView6).</p>

<p>Here is an example :</p>

<pre><code>SecondViewController *secondview;

-(IBAction)goToView2 {
    secondview = [[SecondViewController alloc] 
                 initWithNibName:@"SecondViewController" bundle:nil];
    [self.view addSubview:secondview.view];
}
</code></pre>

<p>But as you can see, if I want to go from view3 to view2, I'm not deleting the view3 from the stack : I'm just adding the view2 over it.
So here's my problem, how do I "delete" my view before using addSubView ?
I tried with removeFromSuperView, but I think I'm not using it right.</p>

<p>Thanks for helping, as I said I'm really new and I am aware it can be a stupid question :/</p>
