Reputation: 5321
i want to show uo a viewcontroller connected via a seque from the first view of the rootviewcontroller which is a navigation controller. I tried the following code. But it doesnt work for me : [_window.rootViewController.navigationController performSegueWithIdentifier:@"showLoginScreen" sender:self];
What i am doing wrong : Here is a screen shot of my storyboard connections :
I want to show the MainViewController after startup.
Upvotes: 0
Views: 127
Reputation: 6692
Have you tried something along the following lines:
MainViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"ShowLoginScreen"];
[self.navigationController pushViewController:controller animated:YES];
You need to obtain a reference to the view controller via the storyboard.
Upvotes: 1