iphone - Monotouch Replacing the RootViewController -


using monotouch add logonviewcontroller window , show on finishedlaunching:

        window = new uiwindow(uiscreen.mainscreen.bounds);         window.rootviewcontroller = new logonviewcontroller();         window.makekeyandvisible(); 

in logonviewcontroller, how add main vc, called mainviewcontoller , remove logonviewcontroller? (this action happen once user logged in.)

even if it's possible replace window.rootviewcontroller, that's not how it's done. of time, define rootviewcontroller , handle navigation, including login, there. that's @ least how it.

//appdelegate.cs public override bool finishedlaunching (uiapplication app, nsdictionary options) {     window = new uiwindow (uiscreen.mainscreen.bounds);     window.rootviewcontroller = new mainviewcontroller ();           window.makekeyandvisible ();     return true; }  //mainviewcontroller.cs public override void viewdidload () {     base.viewdidload ();     if (not_logged_in)         presentviewcontroller (new loginviewcontroller (), true, ()=>{}); } 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -