开发者

How to access/reload a tab view?

开发者 https://www.devze.com 2023-01-26 15:10 出处:网络
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 v

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];
}
0

精彩评论

暂无评论...
验证码 换一张
取 消