【发布时间】:2013-07-02 15:27:59
【问题描述】:
我有三个 ViewController:
RootViewController
FirstViewController
SecondViewController
我从 RootViewController 创建了一个 TabBarController 和其他两个 ViewController。所以我需要做类似的事情:
FirstViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
SecondViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
然后将控制器添加到 TabBarController。 在那一刻,我的两个 ViewController 被实例化了。
要更新我在FirstViewController.m 中尝试过的数据:
SecondViewController *test = [[SecondViewController alloc] init];
[test.tableView reloadData];
但是什么也没发生,我想是因为我的 SecondViewController 之前已经分配过,并且正在创建它的一个新实例。
如何从我的 FirstViewController 更新我在 SecondViewController 中的表的数据?
【问题讨论】:
标签: iphone ios uitableview uiviewcontroller reloaddata