3

Sorry for the another newbie question.

I tried to get the back button text value in viewDidLoad but it always displays null when I navigate through controllers.

NSLog(@"-----------> %@ ", self.navigationItem.backBarButtonItem.title);

How to get the back button text value?

Vladimir
  • 170,431
  • 36
  • 387
  • 313
tom_987
  • 91
  • 1
  • 1
  • 4
  • 1
    I found the solution. Get all the view controllers from navigation controller. You can get the title from last but one view controller (lastButOneController.navigationItem.title). I did this viewWillAppear function. – tom_987 Aug 10 '10 at 09:48
  • Hi, if you put your comment as an answer to this question and then accept it, people know it's answered ;) – deanWombourne Aug 10 '10 at 10:25

1 Answers1

5

Use self.navigationController.navigationBar.backItem.title :)!

Shamas S
  • 7,507
  • 10
  • 46
  • 58
cutsoy
  • 10,127
  • 4
  • 40
  • 57