Sunday, 15 June 2014

ios - Displaying UIView with Tab Bar and Navigation Bar in ObjectiveC -



ios - Displaying UIView with Tab Bar and Navigation Bar in ObjectiveC -

i'm developing app requires user login total functionality, allow user skip logging in browse around.

in storyboard, have uiviewcontroller acts login screen. when click skip button, goes onto next screen.

here when run problems... want screen pops when user presses skip have navigation bar , tab bar. add together 2 things in , works.

in app delegate file check see if user has skipped app go straight menu screen. problem is, goes blank white screen without navigation bar , tab bar. works fine when press skip, not when relaunch app after closing it.

here code checks if user has skipped login:

//check nsuserdefaults value skiplogin bool skiplogin = [[nsuserdefaults standarduserdefaults] objectforkey:kacuserdefaultsskippedloginkey]; //check see if user has logged in or has pressed skip button. //if not, show loginviewcontroller if(skiplogin || [pfuser currentuser]) { uistoryboard *storyboard = [uistoryboard storyboardwithname:@"main" bundle:nil]; menuviewcontroller *menuview = [storyboard instantiateviewcontrollerwithidentifier:@"menuview"]; self.window.rootviewcontroller = menuview; }else{ uistoryboard *storyboard = [uistoryboard storyboardwithname:@"main" bundle:nil]; loginviewcontroller *loginview = [storyboard instantiateviewcontrollerwithidentifier:@"loginview"]; self.window.rootviewcontroller = loginview; }

what doing wrong?

why don't utilize performseguewithidentifier force new view controller? maybe problem loading storyboard , setting rootviewcontroller of window.

ios objective-c uiview uinavigationcontroller uitabbarcontroller

No comments:

Post a Comment