I am trying to switch to different ViewController on same storyboard like so:
CalendarViewController *CalViewController = [[CalendarViewController alloc] init]; [self presentViewController:CalViewController animated:NO completion:nil];
When I run this action, corresponding implementation file executes NSLog message but screen goes black with no errors being displayed.
How do I fix this?
Let's suppose you created your CalendarViewController interface in a storyboard, and you assigned it the identifier "ControllerIdentifier".
If you want to load it from inside another View Controller, you can instantiate your CalendarViewController and present it like this:
You can use Segue to push calViewController.
You can use the code below;
CalendarViewController *CalViewController = (CalendarViewController *)[self.storyboard instantiateViewControllerWithIdentifier:@"CalendarViewControllerIdentifier"]; [self presentViewController:CalViewController animated:NO completion:nil];
But if you choose the second option, you have to set CalendarViewController's Storyboard Identifier to CalendarViewControllerIdentifier from your storyboard.