Both audio and Flaviu approaches are fine. But you are missing one extra line of code.
I found out that you need to first select and run the UIWindow object. I don’t know why, but initializing the object solved the problems.
self.window=[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
audiophile approach:
self.window=[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle: nil]; ResultsInListViewController *resultsInListViewController = (ResultsInListViewController *)[mainStoryboard instantiateViewControllerWithIdentifier:@"ResultsInListViewController"]; [self.window addSubview:resultsInListViewController.view]; [self.window makeKeyAndVisible];
Flavi:
self.window=[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle: nil]; ResultsInListViewController *resultsInListViewController = (ResultsInListViewController *)[mainStoryboard instantiateViewControllerWithIdentifier:@"ResultsInListViewController"]; [self.window setRootViewController:resultsInListViewController]; [self.window makeKeyAndVisible];
source share