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

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -