I have a tabbar application that has one screen that displays statistics based on the data presented in the tableviews of over tab screens. I would like to refresh this view once the stats view becomes selected again. I have implemented the tabbarcontrollerdelegate protocol to take an action when the viewcontroller.tabbaritem.title isequaltostring:@"foo". which works fine for my nslog statement but when i try and trigger the viewcontroller to execute the viewdidload method it never happens. And the code to refresh the stats view is in the viewdidload method.
From my AppDelegate
- (void)tabBarController:(UITabBarController*)tabBarController didEndCustomizingViewControllers: (NSArray*)viewControllers changed:(BOOL)changed
{
}
- (void)tabBarController:(UITabBarController*)tabBarController didSelectViewController:(UIViewController*)viewController {
if([viewController.tabBarItem.title isEqualToString:@"Summary"]) {
NSLog(@"didSelectViewController %@", viewController.tabBarItem.title);
[viewController viewDidLoad]; //FAIL
}
}