I use the method performSegueWithIdentifier:sender:
to open a new ViewController
from a storyboard-file programmatically. This works like a charm.<
To reuse an existing UIViewController
instance with a segue create the segue from scratch and provide your own (existing) destination (UIViewController
). Do not forget to call prepareForSegue:
if needed.
For example:
UIStoryboardSegue* aSegue = [[UIStoryboardSegue alloc] initWithIdentifier:@"yourSegueIdentifier" source:self destination:self.existingViewController]
[self prepareForSegue:aSegue sender:self];
[aSegue perform];