How to pass parameters to a popover view controller inside a navigation controller

后端 未结 2 1099
清酒与你
清酒与你 2021-01-13 16:48

I have an iPad app with splitview and a right bar button in the navigation bar of the detailviewcontroller.

This button calls a popover constituted of a navigation c

2条回答
  •  青春惊慌失措
    2021-01-13 17:05

    I'm not entirely sure I follow, because the storyboard is a bit small for me to read. But you seem in your code to have created a sparkling new popoverFirstTVC and then thrown it away by the assignment

    popoverFirstTVC = segue.destinationViewController;
    

    If you comment that line out, then at then end write

    segue.destinationViewController.itsPopover = popoverFirstTVC;
    

    then you can pass off your fully-constructed and initialised popoverFirstTVC and have code in the second VC pick it up and run with it. Of course, you need

    @property (strong, readwrite) MyPopoverFirstTableViewController * itsPopover;
    

    in the header for your second VC.

提交回复
热议问题