简体   繁体   中英

Load UISplitViewController from UITableView

I am building an iPad app that loads a UITableView with some information. On the didSelectRowAtIndexPath function I would like to load a UISplitViewController . I created a segue from the cell to the split view but then I get the following error:

Split View Controllers cannot be pushed to a Navigation Controller .

I am still new to iOS development, so can someone help me out a bit.

Indeed, the segue to use is not a Push segue but a Replace one.

Using UISplitViewController requires some configuration, so I can't give you the code here. I had to make a UISplitViewController recently and I've succeeded thanks to this great tutorial . Tell me if you have any question/problem.

Apple states that the split view controller is typically the root view controller here . They then go ahead and suggest that using it in any other way is not recommended. I would follow that advise. In my own experience UISplitViewController can be a pain if you try to use it in any other way where it is not the root view controller. You could therefore write up your own, or make use of the other third party solutions available. I personally wrote up one myself and it is better than anything else I have trialled, with much less code. MGSplitViewController is one of the few I trialled, was terrible, and the code underneath handles a lot of things the wrong way, like sending rotation messages to its child view controllers through notifications. Im calling them childViewControllers but they were actually not added as such. You learn a few things too if you do it yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM