Switching back from horizontal view causes iPhone application to crash
<p>Here is my problem:
- I have one navcontroller and inside it one tabbar controller with 4 view controller. 
- I want to add following functionality:
 - On landscapeRight to dismiss navcontroller, tabbar controller and everything and load whole new controller - this one goes ok, here is the code:</p>

<pre><code>- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    MyAppDelegate *appDelegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
    // Just delete the lines for the orientations you don't want to support
    if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
            [appDelegate ToHorizontalAverageResponseView:self];
    }
    return YES;
}
</code></pre>

<p>Here is the code in the App Delegate:</p>

<pre><code>- (void)ToHorizontalAverageResponseView:(id)sender
{
    HorizontalResponseViewController *tempController = [[HorizontalResponseViewController alloc] initWithNibName:nil bundle:nil];
    [self setHorizontalResponseViewController: tempController];
    [tempController release];
    //[UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeRight;
    // View rotation transformation
    CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation( M_PI * 90.0 / 180.0 );
    [[horizontalResponseViewController view] setTransform:landscapeTransform];

    [window addSubview:[horizontalResponseViewController view]];
}
</code></pre>

<p>The question is how to transfer back to portrait view and all those navbar and tabbar controllers?</p>

<p>Thx,
Mladen</p>
