opening previous/back screen in iphone clicking on leftbarbuttonitem showing alert with "ok" and "cancel"
<p>i am working on a navigation based application.On the top of the navigation bar there is a by default back button option.i have implemented a uialertview on click event of the back button.</p>

<pre><code>-(IBAction)gotolevelcontroller:(id)sender//method is declared in leftbarbuttonitem's action selector
{  
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Exit" message:@"Do You want to exit?" delegate:self cancelButtonTitle:@"OK"
                                          otherButtonTitles:@"Cancel", nil];  
    alert.delegate = self;  
    [alert show];  
    [alert release];    
}

- (void)alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)buttonIndex {    
    if (buttonIndex == 0)
    {
        //go to previous screen of navigation control.
            //what is code to go to previous screen
        NSLog(@"ok");
    }
    else
    {
        //remain on same screen of navigation control
        NSLog(@"cancel");
    }
}
</code></pre>

<p>any suggestions?
Thanks</p>
