本文介绍了viewDidDisappear没有在UINavigationController上调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的导航控制器出了问题。如果我将视图控制器添加到堆栈:

I'm having a problem with my navigation controller. If I add a view controller to the stack:

- (void) tui_ToggleListStudy:(id)sender
{
    listVC = [[ListViewController alloc] init];
    [self.navigationController pushViewController:listVC animated:NO];
    [listVC release];
}

我有以下视图控制器的NSLog消息,对于 viewWillDisappear: viewDidDisappear - 但只有 viewWillDisappear:被调用。

I have NSLog messages for the view controller beneath, for both viewWillDisappear: and viewDidDisappear - but only viewWillDisappear: is getting called.

不仅如此,视图控制器也不会收到任何其他委托消息:否 viewDidUnload ,或者 dealloc ...

Not only that, but the view controller doesn't receive any other delegate messages either: No viewDidUnload, or dealloc...

我能做些什么吗?

我很难过!有什么想法吗?

I'm stumped! Any thoughts?

谢谢!

推荐答案

我知道答案你在你的问题代码中犯了同样的错误:方法签名是 viewDidDisappear:动画参数),而不是 viewDidDisappear

I know the answer if you made the same typo in your code that you made in your question: the method signature is viewDidDisappear: (with the animated argument), not viewDidDisappear.

当你使用视图控制器时不会被释放将另一个控制器推入堆栈。除非内存不足,否则不会调用 viewDidUnload

A view controller will not be deallocated when you push another controller onto the stack. And viewDidUnload won't be called unless you run out of memory.

这篇关于viewDidDisappear没有在UINavigationController上调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 06:46