I have a navigation controller than manages a view with a custom component that does not show up on the storyboards/interface builder. When I trigger a particular action, I would like to push on the next view controller. I can do this in code, but I would like to stick to storyboards as much as possible. Is there a way to establish this link?

Thanks

share|improve this question

72% accept rate
feedback

1 Answer

Use prepareForSegue in your (root) view controller:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([segue.identifier isEqualToString:@"SeguName"]) {
        UINavigationController * navigationController = segue.destinationViewController;
        PlayerDetailsViewController * playerDetailsViewController = [[navigationController viewControllers] objectAtIndex:0];
        playerDetailsViewController.delegate = self;
    }
}
share|improve this answer
feedback

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.