Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Declare your splitviewcontroller in your delegate header, use something like this in your didfinishlaunching</p> <p>ensure you add the UISplitViewControllerDelegate to the detailedViewController header file and that you have the delegate methods aswell. remember to import relevant header files</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { splitViewController = [[UISplitViewController alloc] init]; rootViewController *root = [[rootViewController alloc] init]; detailedViewController *detail = [[detailedViewController alloc] init]; UINavigationController *rootNav = [[UINavigationController alloc] initWithRootViewController:root]; UINavigationController *detailNav = [[UINavigationController alloc] initWithRootViewController:detail]; splitViewController.viewControllers = [NSArray arrayWithObjects:rootNav, detailNav, nil]; splitViewController.delegate = detail; [window addSubview:splitViewController.view]; </code></pre> <p>EDIT - as per Scott's excellent suggestion below, don't add to the windows subview, instead</p> <pre><code> [self.window setRootViewController:(UIViewController*)splitViewController]; // that's the ticket [window makeKeyAndVisible]; return YES; } //detailedView delegate methods - (void)splitViewController:(UISplitViewController*)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController:(UIPopoverController*)pc { [barButtonItem setTitle:@"your title"]; self.navigationItem.leftBarButtonItem = barButtonItem; } - (void)splitViewController:(UISplitViewController*)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem { self.navigationItem.leftBarButtonItem = nil; } </code></pre> <p>I also prefer code to IB ;-)</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.
 

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