segue does not work in simple segue test

reinvdo picture reinvdo · Jan 7, 2012 · Viewed 10.7k times · Source

I have a weird problem. I have created 2 viewcontrollers in my storyboard: testSegueViewcontroller and nextPageViewController.
The testSegueViewcontroller contains a UIButton NextPage. I Ctrl-dragged from this button to nextPageViewController and created a Push segue.

The problem is when i run this program and clicking on the NextButton in the testSegueViewcontroller it does not show the nextPageVieController :-(

Any ideas of what I'm doing wrong?

Answer

voromax picture voromax · Jan 7, 2012

With this approach you should use modal segues. Push segue is a part of UINavigationController transitions

If you want to use push segue then you will need to put your testSegueViewcontroller into UINavigationController instance. This will allow the Push segue to work.