第一種方案:
? ? AppDelegate * appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
? ? UIViewController * controller = appDelegate.window.rootViewController;
? ? UITabBarController * tabBarController = (UITabBarController *)controller;
? ? [tabBarController setSelectedIndex:3];
? ? //假如要跳轉(zhuǎn)到第四個(gè)tabBar那里爹凹,因?yàn)閠abBar默認(rèn)索引是從0開(kāi)始的
? ? [self.navigationController popToRootViewControllerAnimated:YES];
第二種方案:
? ? self.navigationController.tabBarController.selectedIndex = 3;
第三種方案:
self.tabBarController.selectedIndex = 3;