How dismiss a viewController with storyboard from a push segue?

cocoa-touch, iphone, objective-c, segue, storyboard

Solution

Do you have a navigationBar in the viewController that's calling:

[self performSegueWithIdentifier:@"my_segue" sender:self];

If so, you'll need to use:

[self.navigationController popViewControllerAnimated:YES];

to pop the view off the stack. There's one segue call, but the framework seems to call:

presentViewController:animated:completion:

or:

pushViewController:animated:

as appropriate.

Ray

Problem

I don't know why `dismissViewControllerAnimated:completion:`. I just want to do it. I start with a ``` [self performSegueWithIdentifier:@"my_segue" sender:self]; ``` But is I call the dismiss than nothing happens. I can create another segue, but it create a new view controller. My question is: How dismiss the `performSegueWithIdentifier:sender:`?

Original source