ipad-UISplitViewController, change detail view controller


#1

hi, i followed the example from big nerd ranch, chapter 22 UISplitViewController without any problem.

Now i want to code something like the Setting App on IOS where clicking on the selected row on the left menu shows up a different detailViewController on the right. I might have FirstDetailViewController, SecondDetailViewController, ThirdDetailViewController. Each of this view controller has its own nib file.

Most example online shows how we change the label text on the detailViewController but not change the detailViewController. How should i go about doing this?


#2

This can be done easily by swapping views in and out, if you don’t want to use a navigation controller:

  1. Create a new view controller;
  2. If the detail view has a child view already, remove the child view (swap out); and
  3. Add new view controller’s view to the detail view (swap in).

[Become a competent programmer faster than you can imagine: pretty-function.org]