UINavigationController拦截–

UINavigationController拦截–

所以问题是当有人触摸 UINavigationControler 上的后退按钮时,我想运行一些代码来更新数据源。

问题是我似乎找不到合适的代表去做。只有这些在导航 Controller 委托(delegate)上可用,我想要“didfinishshowing”类型方法。

– navigationController:willShowViewController:animated:  optional method
– navigationController:didShowViewController:animated:  optional method

我认为下一个最好的地方是导航栏,但当我尝试时。



回顾起来,这是有道理的,因为您不希望某些黑客搞乱导航 Controller 的内部结构并阻止其工作。

这一定是一个常见问题,我错过了一些简单的事情。

最佳答案

将刷新代码添加到将要显示的 View Controller 上的viewWillAppear:(BOOL)动画方法中。在您的情况下,这就是导航堆栈中已经存在的 View Controller 。

关于iphone - UINavigationController拦截– popViewControllerAnimated :,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/920379/

10-12 03:36