Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not sure what you mean by "app which i am trying to create will be a subview of a main application and would be available on the click of a button"</p> <p>But this is how you can create a uisplitviewcontroller programmatically:</p> <p>1) Initialize your uisplitviewcontroller</p> <pre><code>UISplitViewController *splitviewcontroller = [UISplitViewController alloc] init]; </code></pre> <p>2) Create master and detail uiviewcontrollers </p> <pre><code>UIViewController *masterViewController = [[[UIViewController alloc] init] autorelease]; UIViewController *detailViewController = [[[UIViewController alloc] init] autorelease]; </code></pre> <p>3) Create 2 navigation controllers, 1 for the master and one for the detail views (optional)</p> <pre><code>UINavigationController *masterNavigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease]; UINavigationController *detailNavigationController = [[[UINavigationController alloc] initWithRootViewController:detailViewController] autorelease]; </code></pre> <p>4) Add the nav controllers to the splitviewcontroller (or just the viewcontrollers, if you opted not use the nav controllers)</p> <pre><code>splitViewController.viewControllers = [NSArray arrayWithObjects:masterNavigationController, detailNavigationController, nil] </code></pre> <p>5) Add your uisplitviewcontroller... Let's say you want to display it modally at the click of a button</p> <pre><code>[myCurrentViewController presentModalViewController:splitViewController animated:YES]; </code></pre> <p>Be sure to read up on the delegation pattern for any communications needed between the master/detail views</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload