Change title of main button in UIsplitView

I have an xcode6 project that uses splitView. So now I want to change the title of the "main button" in the detailView. There are different ways to do it are towed here. These methods are implemented in detailViewController and are called from MasterViewController.

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

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

      

If I ran the app in the portrait module for ipad, the name was changed. But if I expand the masterView and after that I reset it, then the title goes back to "Master". I do not know where or how this happens. How can I change the title? Are there some delegate methods?

+3


source to share


1 answer


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

Basically everything you need to do is installed:



self.title = @"Your Title";

      

in your MasterController.m

+5


source







All Articles