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]; 

enter image description here

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

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -