ios - How to use a UISplitTableViewController correctly to display two UITableViewControllers? -
i (still) in process of converting iphone app universal app.
i want push uisplitviewcontroller onto uiview. discussed here trying create flow:
uiview -> uisplitviewcontroller (containing 2 uitableviews use in iphone version) -> uiview
i want button attached ibaction make tableview appear on iphone (which set , working) , splitviewcontroller appear on ipad:
-(ibaction)makestory:(id)sender{ nslog(@"makestory:"); if (ui_user_interface_idiom() == uiuserinterfaceidiompad) { //code here push split view. } else { //i iphone! makestorytableviewcontroller = [[makestorytableviewcontroller alloc] initwithnibname:@"makestorytableviewcontroller" bundle:nil]; [self.navigationcontroller pushviewcontroller:makestorytableviewcontroller animated:yes]; [self.navigationcontroller setnavigationbarhidden:no animated:yes]; } }
i've read tutorials here , here - can't head around how add existing app correctly. appreciate / direction can implement uisplitviewcontroller correctly in universal app.
you can't "push" split view controller or add on top of view. has root view controller of window.
in ibaction simple as:
appwindow.rootviewcontroller = asplitviewcontroller;
of course, have reference app's window, , have asplitviewcontroller initialized left , right view controllers somewhere...
Comments
Post a Comment