4

i've a xcode6 project witch is using the splitView. So now i want to change the title of the "master button" in the detailView. Here tow different ways to do that. This methods are implemented in the detailViewController and are called from the MasterViewController.

- (void)changeMasterButtonTitle:(NSString *)masterButtonTitle {
    self.navigationItem.leftBarButtonItem.title = masterButtonTitle;
}

- (void)changeMasterButtonTitle:(NSString *)masterButtonTitle {
    self.splitViewController.displayModeButtonItem.title = masterButtonTitle;
}

If i launch the app in portrait modus for ipad the title has been changed. But if i expand the masterView and after that i collapse it the title has changed back to "Master". I don't know where and how this happens. How can i change the title permanent? Are there some delegate methods to use?

entropid
  • 5,714
  • 3
  • 29
  • 44
christschn
  • 41
  • 4

1 Answers1

5

Check out this answer. I personally didn't need the second step.

Basically all you have to do is set :

self.title = @"Your Title";

in your MasterController.m

Community
  • 1
  • 1
Benjamin
  • 7,573
  • 3
  • 32
  • 45