dispatch_async(dispatch_get_main_queue(), ^{
MainTabBarController *tabBarController = (MainTabBarController *)[UIApplication sharedApplication].keyWindow.rootViewController;
MainNavigationController * nav = tabBarController.childViewControllers[2];
for (UIViewController *controller in nav.viewControllers) {
if ([controller isKindOfClass:[LocalcityViewController class]]) {
NSLog(@"MineViewController ------%@", controller);
//直接赋值
controller.tabBarItem.title = @"南宁";
LanmuModel *model = self.ColumnsArray[0];
}
}
NSLog(@"topViewController ======%@", nav.topViewController);
});
标签:MainTabBarController,title,dispatch,tabbaritem,controller,nav,tabbar From: https://www.cnblogs.com/whx060900/p/16594275.html