我目前有一个标签栏控制器与其中一个选项卡上的navigationcontroller设置,然后我有一个UITableView笔尖设置为该Navigationcontrollers视图。所有这些都是通过IB建立的,我想保持这种状态。有点像这个教程http://twilloapp.blogspot.com/2009/05/how-to-embed-navigation-controller.html 现在当ViewDidLoad被调用时视图加载完美。但是,当我再通过代码加载进一步意见IEviewDidAppear不在Tabbarcontroller>导航控制器> UITableView触发
MyApp_AppDelegate *delegate = [[UIApplication sharedApplication] delegate];
UINavigationController *nav = (UINavigationController *)delegate.controller.selectedViewController;
newViewController = [[newViewController alloc] initWithNibName:@"newView" bundle:nil];
[nav pushViewController:newViewController animated:YES];
//At this point the view works! and loads
如果我尝试用它可以追溯到我以前的观点精细导航工具栏回去 现在我需要刷新tableview中,当我回去,但呼吁viewDidAppear
不起作用。
我尝试添加UINavigationDelegate
相同的ViewController
类的实现代码如下,然后调用- (void)navigationController:(UINavigationController *)navigationController didShowViewController:
但没有奏效。我也尝试添加与标签栏控制器相同的代理,并在那里添加相同的navigationController didShowViewController:
,但那也失败了。
如何在每次加载视图时刷新此表?
是的,但是我在哪里调用它?这需要进入viewwillAppear或viewDidAppear,以便当视图controlelr出现它刷新表 – Kris 2009-10-30 20:29:50