Whenever I try to present a UISplitViewController modally the application crashes. Thus it must allways be the root view controller. Can anyone confirm that?
-
Just for reference, I think this is the way to go: See similar question: http://stackoverflow.com/a/19983002/1134595 – Thiago F. Alencar Nov 14 '13 at 16:31
5 Answers
From the Apple iPad Programming Guide:
The split view controller’s view should always be installed as the root view of your application window. You should never present a split view inside of a navigation or tab bar interface.
So yes, you cannot present a split view outside of your main application window (that includes modally).
EDIT
The link to the docs above no longer discusses this topic. Relevant discussion can now be found at Apple's View Controller Catalog for iOS, which states the following:
A split view controller must always be the root of any interface you create. In other words, you must always install the view from a UISplitViewController object as the root view of your application’s window. [...] Split view controllers cannot be presented modally.

- 18,002
- 16
- 95
- 164
-
have you tried it? It says "should" not "must". And presenting a splitview modally in fullscreen mode is whether inside of a navigation nor a tab bar interface. That doesn't indicate that it wouldn't be possible in general. – user309305 Apr 05 '10 at 17:49
-
1I haven't tried this myself, but given the fact that Apple recommends not doing it, and that you're experiencing issues with it, it would probably be a better idea to rethink your design. If you want a split view type setup, it would be simple to create your own "split view" setup (rather than UISplitViewController) in Interface Builder and present that modally. – indragie Apr 05 '10 at 18:26
-
10If you try to present a split view modally, you'll get an uncaught exception: "Application tried to present a Split View Controllers modally" [sic] – Kristopher Johnson Apr 17 '10 at 16:29
-
I got the same problem with the same error when I tried to segue from a regular content view controller (ie. no problem segueing from a tab controller or a nav controller).
Fortunately I found a way to circumvent this by inserting a nav controller between the VC and the split view controller. In other word, segue from the VC to a nav controller, then draw a relationship connection between the nav controller and the split view controller. In this way, instantiating a split view still requires no coding.

- 1,248
- 1
- 14
- 16
-
I found that in this solution - inside a Storyboard - the segue from the VC to the nav controller should be a Modal segue. – ghr May 14 '14 at 01:02
Of course u can use UISplitViewController
without using it as root view controller.
In my project, I use it like this:
- Show my own viewcontroller in modal method:
[self presentModalViewController:mainViewController animated:YES];
- In the mainViewController, I have
UISplitViewController *splitViewController;
and in - (void)viewDidLoad
, set the splitViewController.view
to mainViewController.view
splitViewController.viewControllers = [NSArray arrayWithObjects:masterNavigationController, detailNavigationController, nil];
self.view = splitViewController.view;
-
That way you won't get messages from the Split View Controller's delegate, though. – ySgPjx Apr 08 '11 at 13:01
The UISplitController CAN BE installed under UITabBarController. I do it. Just use search on this forum - I found at least one good software sample.

- 51
- 2