Domanda

in my iphone storyboard file a example navigation example is:

NavController --> ListVC1 --push--> ListVC2 --push--> DetailVC1
                                        |-----push--> DetailVC2

on my ipad, it should not be a single page that pushes its controllers to a navigationController, i want to use a splitviewcontroller.

now i want to have my NavController and my ListVC1 and ListVC2 in my MasterViewController, no problem here. The Problem now is changing the push segue from ListVC2 to the two different DetailVC'ers that should now be displayed in my DetailViewControllers view.

RootViewController --> NavController --> ListVC1 --push--> ListVC2
         |-----------------------------------------------------|
         v
DetailViewController (DetailVC1 or DetailVC2)

Since i'm having different "Detail" viewcontrollers and i can't really "push" them to the detailviewcontrollers side of a splitviewcontroller i'm not sure how to implement this right.

what could i do, f.e in my ListVC2, to change this line

[self performSegueWithIdentifier:@"DetailVC1" sender:indexPath]; 
//and
//[self performSegueWithIdentifier:@"DetailVC2" sender:indexPath];

to something that my DetailVC1 / DetailVC12 gets displayed in my DetailViewController's section in my SplitViewController?

È stato utile?

Soluzione

Instead of push segue you use in the iPhone storyboard, use a replace segue. For your items in the second list view controller, control-drag to the correct detail view controller and select Replace. Now, select the segue, open its attribute inspector and set the destination to the detail split.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top