I am trying to learn how to use the UISplitViewController and I am using the “SplitView” example available from Monotouch. I understand how it works and communicates between the Master and Detail controllers.
Therefore it can’t be hard to change the detail controller? So I have made a very small amendment and it doesn’t work! I have read you must use the SetViewControllers but this doesn’t exist in the Monotouch stack. Where am I going wrong?
It’s exactly the same code as the example from Montouch except for the lines below:
public class MainSplitView : UISplitViewController
{
protected Screens.MasterView.MasterTableView masterView;
protected Screens.DetailView.DetailViewScreen detailView;
protected TestViewController testViewController; // *** Added this line
public MainSplitView () : base()
{
// create our master and detail views
masterView = new Screens.MasterView.MasterTableView ();
detailView = new Screens.DetailView.DetailViewScreen ();
masterView.RowClicked += (object sender, MasterView.MasterTableView.RowClickedEventArgs e) =>
{
detailView.Text = e.Item;
testViewController = new TestViewController(); // *** Added this line
ViewControllers[0] = masterView; // *** Added this line
ViewControllers[1] = testViewController; // *** Added this line
// the UISplitViewController.SetViewControllers does not exist! ???
};
ViewControllers = new UIViewController[] { masterView, detailView };
}
All help greatly appreciated!
Mike
Set
ViewControllersexactly how do you do are doing it in the other place:Just do this: