ios - Conditional Navigation Controller Root -
i have tab bar controller navigation controller. want change navigation controller's root view depending on whether or not user logged in. how do this? don't want put code in didfinishlaunchingwithoptions:
or other appdelegate method because won't first thing users see.
you're right, supposed be:
- (void) gonext { nextviewcontroller* nextwindow = [[nextviewcontroller alloc] initwithnibname:@"nextview" bundle:nil]; [self.navigationcontroller setviewcontrollers:[nsarray arraywithobject:nextwindow] animated:yes]; }
since can't pop root view controller, following method can used instead:
- (void)setviewcontrollers:(nsarray *)viewcontrollers animated:(bool)animated
here's link apple docs method.
Comments
Post a Comment