UInavigation controller did not work
<p>I am making app like whenever the device change it's orientation mode it changes it's view.<br>
At first when the view is portrait it shows perfect SearchViewController, then when i rotate to landscape it push to new view MapView in landscape ... now when i again change the view to portrait the map rotate to portrait... but it should be do to search view controller... and one more thing when i tapped detail disclosure button it should be go to back to search view controller... i think navigation controller not work in map view..</p>

<p>this is my code part of searchViewController  </p>

<pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
 {


    //return (interfaceOrientation == UIInterfaceOrientationPortrait);  
    if(interfaceOrientation == UIInterfaceOrientationPortrait|| inte rfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)  
    {  
    }  
    else {  
        MapView *mapView = [[MapView alloc] initWithNibName:@"MapView" bundle:nil];  
        mapView.title = @"Map";  
        [self.navigationController pushViewController:mapView animated:YES];   
        return YES;  

    }  
    return YES;

}  
</code></pre>

<p>and this is my MapView code  </p>

<pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation   {  
    // Return YES for supported orientations  
    //  return (interfaceOrientation == UIInterfaceOrientationLandscapeRight|| UIInterfaceOrientationLandscapeLeft);  
    if(interfaceOrientation == UIInterfaceOrientationPortrait|| interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)  
    {  
        NSLog(@"hi Potrait");  
        [self.navigationController popViewControllerAnimated:NO];  
        return YES;  
    }  
    else {  
    }  
    return YES;  
}
</code></pre>
