Changing The Back Button To Say Something Other Than The Previous Views Title
You can’t change the button text in the new view, you need to do it before the view is shown by simply changing the previous views title before triggering the new view:
[self.navigationItem setTitle:@"Back"];
[self.navigationController pushViewController:Viewer animated:YES];
Adding An Info Button That Displays A New View
Add navigation Bar To Your View Controller
In #ViewController.m
- (id) init
{
[super init];
UIButton* infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
[infoButton addTarget:self action:@selector(showInfoView:) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:infoButton];
[[self navigationItem] setTitle:@"Some Title"];
return self;
}
The method called when the button is pressed
- (void) showInfoView:(id)sender
{
Adding A Back Button
UIBarButtonItem *backButton = [[UIBarButtonItem alloc]
initWithTitle:@"Back"
style:UIBarButtonItemStylePlain
target:self
action:@selector(BackButtonPressed:)];
self.navigationItem.leftBarButtonItem = backButton;
//*********************************
//*********************************
//********** BACK BUTTON **********
//*********************************
//*********************************
- (void)BackButtonPressed:(id)sender
{
}