prajakta
prajakta

Reputation: 673

How to change the text of navigationItem.leftBarButtonItem for iPhone

How do I change the text value navigationItem.leftBarButtonItem?

In view A I did self.title=@"hi"

So when I go to B my back button has the text @"hi". now I want to change it to back

How do I do that?

Upvotes: 0

Views: 2130

Answers (1)

alecnash
alecnash

Reputation: 1768

UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"blah blah blah" style:UIBarButtonItemStylePlain target:nil action:nil];
self.navigationItem.backBarButtonItem = backButton;
[backButton release];

you can use this in view A and enter any text you want

Upvotes: 1

Related Questions