UISplitViewController delegate methods not called

Solved, it has to be at either root level or a direct subview of a tabBar which also must be at root level. Annoying!


First, try to see if you are setting the correct delegates. e.g., lets say you created three controllers,

UISplitViewController* splitView;
UIViewController* masterView;
UIViewController* detailView;

You implemented the delegate protocol at the detail view, so that when orientation changes, detail view should be able to put a button in the toolbar.

Now in order for splitView to call this function from delegate, you need to set the delegate itself.

So somewhere, if you are missing the following call,

splitView.delegate = detailView;

detailView's will never get notified of the orientation changes etc. At least this is where I was stuck.


I like the following method of sending a message from the master UIViewController to the detail UIViewController. Somewhere inside the master's implementation:

id detailViewController = [[self.splitViewController viewControllers] lastObject];
[detailViewController setSomeProperty:…];

This is from Paul Hegarty's Fall 2011 Stanford iTunesU iPad and iPhone Application Development course.