As the title of the post says, when I try to set the title of my detail view in my UISplitViewController
, or add a UIBarButtonItem
to the view controller, neither appears. In the iPhone versions, which of course, does not use the UISplitViewController
, the title and button both appear as expected.
In my viewDidLoad, I have this to set the title:
self.title = @"My Title";
and this to create and add the button:
UIBarButtonItem * addButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(mySelector:)];
self.navigationItem.rightBarButtonItem = addButton;
When I run the app, they only appear on he iPhone, not iPad.
There is also a "Back" navigation item on my view controller, but that appears as expected on both platforms. At some point in the past, this was working just fine, but going back through my commits, I just can't find how I managed to botch this. I fear I'm missing something pretty basic. I'm not using a tab bar controller, but I do use images as backgrounds for the navigation bar. Any ideas?
Mistake on my part. I needed to have my view managed by a UINavigationController. Adding that, fixed my issue.