To create a view controller:
UIViewController * vc = [[UIViewController alloc] init];
To call a view controller (must be called from another view manager):
[self presentViewController:vc animated:YES completion:nil];
For one, use null, not null.
Loading the view controller from the storyboard:
NSString * storyboardName = @"MainStoryboard"; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle: nil]; UIViewController * vc = [storyboard instantiateViewControllerWithIdentifier:@"IDENTIFIER_OF_YOUR_VIEWCONTROLLER"]; [self presentViewController:vc animated:YES completion:nil];
Identifier identifier of your view controller is either the class name of your view controller or the storyboard identifier that you can assign in the identity inspector of your storyboard.
190290000 Ruble Man Apr 21 '13 at 18:29 2013-04-21 18:29
source share