I have a tabbar application with each tab directing user to a UITableViewController. I created another object called MyTimer that extends NSObject. I want MyTimer to execute the function [MyTimer refreshTables] every minute. The contents of the refreshTables function will look somethign like this
-(void) refreshTables:(NSTimer *)timer
{
[tabbar.firstuitableviewcontroller.tableView reloadData];
[tabbar.seconduitableviewcontroller.tableView reloadData];
[tabbar.thirduitableviewcontroller.tableView reloadData];
}
The problem is that I don’t know the correct syntax or chain of variable names I need to use to get a handle tabbar.firstuitableviewcontroller, tabbar.seconduitableviewcontoller etc… Can i get a handle on them from the appdelegate object? or some other way?
Thanks
the rootviewcontroller of my appdelegate was teh tabbarcontroller. So this was valid:
UITabBarController * uitbc = appDelegate.window.rootViewController;
THen i can grab the navigation controller each tab points to by :
// change zero to the index of another tab if you want another one instead
UINavigationController * uinc = [uitbc.viewControllers objectAtIndex:0];