UINavigationController后退按钮问题
我的应用程序有导航控制器和表格视图。当单击后退按钮并且视图从控制器堆栈中弹出时,我注意到表事件未执行(例如:cellForRowIndexPath)。无论如何,当弹出视图时,这些事件是否会被执行。
这是我用来将视图推入控制器堆栈的代码。
MyViewController *obj = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil]; [self.navigationController PushViewController:obj动画:是]; [对象释放];
问候 沙
My Application have navigation controller and table views. When the back button is clicked and the view is popped out from controller stack, i noticed that the table events are not executed (eg: cellForRowIndexPath). Is there anyway that these events are execueted when view is popped out.
This is the code i use for pushing the view into controller stack.
MyViewController *obj = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
[self.navigationController pushViewController:obj animated:YES];
[obj release];
Regards
Sandy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 ViewWillAppear 和 ViewWillDisappear 方法。
你想要做的是调用
[theTable reloadData];
它会启动您想要的所有呼叫。
此调用应放置在您希望表重新加载的位置 - 无论是出现还是消失。
祝你好运 !
You can use the ViewWillAppear and ViewWillDisappear methods.
what you want to do is put a call to
[theTable reloadData];
which initiates all of the calls that you wanted.
This call should be placed where you want the table to reload - either on appear or disappear.
Good Luck !