PerformSegueWithIdentifier and viewDidLoad
MainViewController:
[self performSegueWithIdentifier:@"showNextVC sender:self];
Segue Destination Controller:
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"Show text!");
[self performSegueWithIdentifier:@"showSignUp" sender:self]; }
Why isn't the code from the viewDidLoad method of the destination controller executed?
+3
source to share
2 answers
viewDidLoad is called when the ViewController object is created by loading the nib file. It is not yet attached to the window. You have to call performSegue function ... call viewDidAppear.
Finally if you call performSegue function directly without any action. I would suggest that you take a look at the flow again.
+11
source to share