Tuesday, April 5, 2011

UINavigation back pop View Controller

-(void)goBack:(id)sender

{

[self.navigationController popViewControllerAnimated:YES];

//[self.navigationController popToRootViewControllerAnimated:YES];

}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {





#pragma mark back buttonw

UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(0, 0, 55, 30);
[button setImage:[UIImage imageNamed:@"backButton.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(goBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem* btBack = [[UIBarButtonItem alloc] initWithCustomView:button];
self.navigationItem.leftBarButtonItem = btBack;
}

FEEDJIT Live