viewDidDisappear 没有在 UINavigationController 上被调用

2023-06-10移动开发问题
11

本文介绍了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];
}

我有 viewWillDisappear:viewDidDisappear 下面的视图控制器的 NSLog 消息 - 但只有 viewWillDisappear: 被调用.

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

不仅如此,视图控制器也没有收到任何其他委托消息:没有 viewDidUnloaddealloc...

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:(使用 animated 参数),而不是 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.

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

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

当您将另一个控制器压入堆栈时,视图控制器不会被释放.除非内存不足,否则不会调用 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 上被调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

硬件音量按钮更改应用程序音量
Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)...
2024-08-12 移动开发问题
10

Cocos2d - 如何检查不同层中对象之间的交集
Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)...
2024-08-12 移动开发问题
8

恢复游戏 cocos2d
Resume game cocos2d(恢复游戏 cocos2d)...
2024-08-12 移动开发问题
6

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

如何将 32 位 PNG 转换为 RGB565?
How to convert 32 bit PNG to RGB565?(如何将 32 位 PNG 转换为 RGB565?)...
2024-08-12 移动开发问题
21

正确的 cocos2d 场景重启?
Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)...
2024-08-12 移动开发问题
7