ios - Get Access to Embed tabBarController in App Delegate -
i facing problem can access embed tabbarcontroller , set index2
i have tried following code won't work , goes first index:
uistoryboard *secondstoryboard = [uistoryboard storyboardwithname:@"mainfunction" bundle:nil]; myviewcontroller *theinitialviewcontroller = [secondstoryboard instantiateinitialviewcontroller]; self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; self.window.rootviewcontroller = theinitialviewcontroller; [self.window.rootviewcontroller.tabbarcontroller setselectedindex:2];/ [self.window.rootviewcontroller.navigationcontroller.tabbarcontroller setselectedindex:2]; [self.window makekeyandvisible];
it can't change second tab using above code.
can give me advice? thank .
the viewcontroller getting story board tab bar controller.
uistoryboard *secondstoryboard = [uistoryboard storyboardwithname:@"mainfunction" bundle:nil]; uitabbarviewcontroller *theinitialviewcontroller = [secondstoryboard instantiateinitialviewcontroller]; self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; self.window.rootviewcontroller = theinitialviewcontroller; [theinitialviewcontroller setselectedindex:2]; [self.window makekeyandvisible];
Comments
Post a Comment