I'm trying to present a viewController programmatically:
- (void)viewDidLoad {
[super viewDidLoad];
NewViewController *vc = [[NewViewController alloc] init];
[self presentViewController:vc animated:YES completion:nil];
}
But I'm getting this error:
Presenting view controllers on detached view controllers is discouraged
and also I'm getting black screen on the iPhone.
This is how my storyboard and iPhone looks like:
Any o you knows why I'm getting this error and also why I'm getting the black screen ?
I'll really appreciate your help.