Reputation: 7304
Initially I developed the app with only one ViewController(called MainView). Now I'd like to add one ViewController (called LoginView)infront of MainView. I added in the AppDelegate as
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
UIStoryboard *mainStoryBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
LoginPage *RootViewController = [mainStoryBoard instantiateViewControllerWithIdentifier:@"LoginPage"];
[UIApplication sharedApplication].delegate.window.rootViewController = RootViewController;
[[UIApplication sharedApplication].delegate.window makeKeyAndVisible];
return YES;
}
It looks working, but only black screen appears. My LoginPage ViewController has the following structure. The ViewController has two buttons, one label and one text view. They don't appear and only black screen is appearer.
Upvotes: 0
Views: 90
Reputation: 1557
Just mark your Login view controller as initial view controller in storyboard
Upvotes: 2