1

I'm trying to implement a UISplitViewController which has different UIDetailViewControllers. I've created a delegate that all the detail views implement. It only has a UIBarButtonItem which is the button used to access the master view in portrait mode. All works well with one exception: when I replace the detail view controller, the button doesn't appear. In my master view controller, which is where I implement the UISplitViewControllerDelegate, the shouldHideViewController is called but the willHideViewController isn't. I checked that the shouldHideViewController returns YES. Any idea of what could make the shouldHideViewController being called but not the willHideViewController? Shouldn't they always be called together, if the first one returns YES? If I rotate the device after replacing the detail view, everything works fine.

Adriana
  • 806
  • 11
  • 36
  • 1
    Is the UISplitViewController the rootViewController of your UIWIndows? Have some trouble when it is not. – Mathieu Hausherr Mar 14 '12 at 17:27
  • The master view controller has a navigation controller. When I'm on the third screen, that's where I replace the detail view. Is that a problem? – Adriana Mar 14 '12 at 17:37
  • I finally got it working :-) I had to transfer the split view BarButtonItem to the new detail view controller. – Adriana Mar 15 '12 at 10:29

1 Answers1

1

Did you set the delegate in awakeFromNib: or viewDidLoad: ?

If you set in viewDidLoad - your delegate won't be set when in storyboard

John67
  • 321
  • 1
  • 2
  • 12