objective c - Changing the first ViewController in iOS -


initially developed app 1 viewcontroller(called mainview). i'd add 1 viewcontroller (called loginview)infront of mainview. added in appdelegate

- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions {     // override point 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, black screen appears. loginpage viewcontroller has following structure. viewcontroller has 2 buttons, 1 label , 1 text view. don't appear , black screen appearer.

enter image description here

just mark login view controller initial view controller in storyboard

enter image description here


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -