I'm puzzed. The UIToolbar
in my iPhone-only app behaves differently when run on an iPad. On the iPhone I get the desired result (UIToolbar
is visible), the same app run on the iPad doesn't show the UIToolbar
at all.
I assume I'd doing something wrong, but I can't imagine how the same app would behave differently -- same version of iOS 7.0.3 -- iPhone vs iPad.
I dragged on a UIToolbar to my Storyboard and added UIBarButtonItems to it. I connected these as IBOutlets to the view controller header file. I do this:
NSArray *items = @[self.buttonBarItemShare, self.buttonBarItemFlexibleFirst, self.buttonBarItemDuplicate];
[self.bottomToolbar setItems:items]; // works on iPhone, no toolbar on iPad
On the iPhone I see it, on the iPad I don't.
I also tried to do this:
NSArray *items = @[self.buttonBarItemShare, self.buttonBarItemFlexibleFirst, self.buttonBarItemDuplicate];
[self setToolbarItems:items]; // visible on iPhone, nothing on iPad
With the result that when run on the iPhone the toolbar and all the buttons as they appear on the Storyboard are visible -- which are not the ones in the items
array above and I can't get at the buttons via the IBOutlets. And when run on the iPad there is no toolbar at all.
I can understand (and expect) that I am doing something wrong, but why is the behavior different depending on the device?
UPDATE:
@Aaron Brager pointed me directly how to debug this. It was a constraint error.