Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've had the same problem when working with UISplitView. In fact, i still got a problem now when i finally figured out how to push a splitview on top of a rootviewcontroller. </p> <p>So, I believe there are lots of newbs out there who are frustrated by this problem. I tried to figure out the solution by lots of reading here.</p> <p>Here's what i do (you can do the same with any other view) :</p> <p>This will dismiss a splitview and push another splitview:</p> <pre><code>SplitViewController *split = [[SplitViewController alloc]init]; self.leftController = [[LeftViewController alloc]init]; UINavigationController *leftNav = [[UINavigationController alloc]initWithRootViewController:leftController]; self.rightController = [[RightViewController alloc]init]; UINavigationController *rightNav = [[UINavigationController alloc]initWithRootViewController:rightController]; split.viewControllers = [NSArray arrayWithObjects:leftNav,rightNav, nil]; split.delegate = self.rightController; YourAppDelegate *delegate = (YourAppDelegate *)[[UIApplication sharedApplication] delegate]; delegate.window.rootViewController = split; </code></pre> <p>And the second option is :</p> <pre><code>NSMutableArray *allViewControllers = [NSMutableArray arrayWithArray:self.navigationController.viewControllers]; [allViewControllers replaceObjectAtIndex:0 withObject:split]; self.navigationController.viewControllers = allViewControllers; </code></pre> <p>Hopefully this would be a help to others who are stumbled with the same problem.</p> <p>Cheers!</p>
    singulars
    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. 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