How to access/reload a tab view?
I have a tab-based app with two table view tabs, set up in IB. On one of the tabs, there is a button that causes another view to pop up and let's the user enter some info. When the user closes that view, I need the tab views to reload with the new info. I've heard about the reloadData method, but I can't call it because I don't know how to refer to my tab view instances.
edit In my AppDelegate, I have a UITabBarController* rootController, and I tried [rootController reloadData]; but I got a warning that rootController might not respond to reloadData. I guess reloadData is only for table views? Is there some way to refer to each tab's view maybe l开发者_JAVA技巧ike [rootController.tab1 reloadData]; ? Thanks.
NSArray *vcs = [[self tabBarController] viewControllers];
for (UITableViewController *tv in vcs)
{
[tv.tableView reloadData];
}
精彩评论