UINavigationController后退按钮问题

发布于 2024-08-21 07:53:37 字数 318 浏览 5 评论 0原文

我的应用程序有导航控制器和表格视图。当单击后退按钮并且视图从控制器堆栈中弹出时,我注意到表事件未执行(例如: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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

待天淡蓝洁白时 2024-08-28 07:53:37

您可以使用 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 !

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文