问题
Using storyboards, I have a view controller which segues to another.
I have two segues, one from a button and one from the view controller.
I want to fire the view controller segue programmatically based on certain conditions, so in the viewDidLoad method of the first screen I call
[self performSegueWithIdentifier:@"SkipName" sender:self];
Using the debugger I can see that prepareForSegue gets called, but the view doesn't move on. Any help greatly appreciated.
回答1:
Putting it in viewDidAppear did the trick, thanks @danielbeard !
Also, to use a push segue the views need to belong to a navigation controller. You dont' get any errors, it just doesn't work.
来源:https://stackoverflow.com/questions/10222798/segue-fires-but-screen-doesnt-transition