what is the opposite of pushviewcontroller in iphone?
I m working on one project in which I m calling other viewcontroller in the below way:--
AppDelegate *app2 = (AppDelegate *)[[UIApplication sharedApplication]delegate];
[self.navigationController pushViewController:app2.SecondForm animated:NO];
app2 =nil;
My application is navigation based and in which I have created my on back button on navigation bar
-(void)viewDidLoad
{
self.navigationItem.leftBarBu开发者_Go百科ttonItem = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarStyleBlackOpaque target:self action:@selector(Back:)];
}
in this way my Back action will call on click
-(IBAction)Back:(id)sender
{
// What code I will write over here to get the same functionality
// which is by default given by navigation controller?
}
I think you are looking for:
[self.navigationController popViewControllerAnimated:YES];
popViewControllerAnimated
精彩评论