pass data to view controller using storyboard segue iOS

后端 未结 1 680
猫巷女王i
猫巷女王i 2021-01-21 05:34

I know there are lots of postings about this but I have tried everything and nothing has worked. So I have tried to pass an object between two view controllers, to a DBKIngredi

相关标签:
1条回答
  • 2021-01-21 05:43

    Are you sure that segue.destinationViewController is a UINavigationController? It seems like it's just a DBKIngredientsViewController so this should work:

    DBKIngredientsViewController *controller = (DBKIngredientsViewController *)segue.destinationViewController
    

    Also if DBKViewController already has a navigation controller then you do not need a second one if you are pushing DBKIngredientsViewController. You would only need a second one if you are modally displaying DBKIngredientsViewController.

    0 讨论(0)
提交回复
热议问题