AppDelegate *app = (AppDelegate *)[UIApplication sharedApplication].delegate;
UIViewController *controller = app.window.rootViewController;
【(SuerTabBarViewController是继承于TabBarViewController的相当于mainViewController)】 SuerTabBarViewController *rvc = (SuerTabBarViewController *)controller;
[rvc setSelectedIndex:3];//假如要跳转到第四个tabBar那里,因为tabBar默认索引是从0开始的
[weakSelf.navigationController popToRootViewControllerAnimated:YES];