objective c - how to perform navigation[segue] from midle of the flow + ios application -



objective c - how to perform navigation[segue] from midle of the flow + ios application -

im working on navigation based application. have used story board design interfaces. , utilize login functionality too. in app delegate class im checking weather user has loged in , according login state im loading either home page or login page.

my problem , when open view controller , other functions not working.

such , have button in home page force view. when app launch home, button not working.[does not force desired view ]. tried programmatically did not worked well.

so here how story board looks like

here app delegate code open app according login status

nsuserdefaults* userinfo = [nsuserdefaults standarduserdefaults]; nsstring* client =[userinfo stringforkey:@"username"]; if((customer!=nil)){ //redirect diferent pages // detailpageclass *detailpage = [[detailpageclass alloc] initwithnibname:@"detailpageclass" bundle:nil]; uistoryboard *mainstoryboard = [uistoryboard storyboardwithname:@"main" bundle: nil]; home *home = (home *)[mainstoryboard instantiateviewcontrollerwithidentifier:@"home"]; //loginview *login = (loginview *)[mainstoryboard instantiateviewcontrollerwithidentifier:@"login"]; home.modaltransitionstyle = uimodaltransitionstylefliphorizontal; self.window.rootviewcontroller = home; [self.navcontroller pushviewcontroller:home animated:yes]; }else{ uistoryboard *mainstoryboard = [uistoryboard storyboardwithname:@"main" bundle: nil]; loginview *login = (loginview *)[mainstoryboard instantiateviewcontrollerwithidentifier:@"login"]; login.modaltransitionstyle = uimodaltransitionstylefliphorizontal; self.window.rootviewcontroller = login; [self.navcontroller pushviewcontroller:login animated:yes]; }

and trying force views below (programmatically)

uistoryboard *mainstoryboard = [uistoryboard storyboardwithname:@"main" bundle: nil]; signup *login = (signup *)[mainstoryboard instantiateviewcontrollerwithidentifier:@"signup"]; //uinavigationcontroller *passcodenavigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:login]; // [self.navigationcontroller presentmodalviewcontroller:passcodenavigationcontroller animated:yes]; [self.nav pushviewcontroller:login animated:yes];

can tell me how in right way. , issue got here..please help me

thank you.

you can create window.rootviewcontroller navcontroller, should work.

ios objective-c iphone uinavigationcontroller segue

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -