在该控制类里面写一个方法:
- (void)setDataSource{
tabview.dataSource = nil;
tabview.dataSource = self;
}
在AppDelegate.m中调用:
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
if(viewController.tabBarItem.tag == 3){
UINavigationController *navigationctr = (UINavigationController *)viewController;
SecondViewController *secvc = (SecondViewController *)navigationctr.topViewController;
[secvc setDataSource];
}
}