Xcode 4 UIButton segue push to Table View Controller

后端 未结 2 757
执念已碎
执念已碎 2021-01-07 03:54

Right now I have a UIButton setup in my storyboard that pushes to a Table View Controller. This is working as expected. What I am trying to do is have the

2条回答
  •  [愿得一人]
    2021-01-07 04:38

    There is a method:

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
        //You can access the tableviewcontroller using segue.destinationViewController
        //Maybe you want to set your model here.
    }
    

    That is called before a segue is made. Here you can do all the setup you need. You should place this method inside the controller that performs the segue, not the one receiving it. (In fact, probably xcode already put that piece of code for you).

提交回复
热议问题