未调用viewDidAppear和viewWillDisappe

未调用viewDidAppear和viewWillDisappe

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

问题描述

我正在使用nib文件创建UIViewController吗?

I am creating a UIViewController using the nib file ?

我已经实现了以下两种方法

I have implemented the following 2 methods

  • (void)viewDidAppear:(BOOL)动画
  • (void)viewWillAppear:(BOOL)动画

在我的视图控制器中,但是这些方法不是每次都被调用吗?

in my view controller, but these methods are not getting called every time ?

代码中的错误是什么?

推荐答案

根据您加载viewController的方式,您的

Depending on how you load your viewController, your

(void)viewDidAppear:(BOOL)animated
(void)viewWillAppear:(BOOL)animated

不会被呼叫.

这是一种方法我加载了视图控制器.如您所见,我自己明确地调用了viewDidAppear,viewDidDisappear等.

Here is one way I load viewcontrollers. As you see, I explicitly call viewDidAppear, viewDidDisappear, etc. myself.

这篇关于在UIViewController中未调用viewDidAppear和viewWillDisappear的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 05:13