why my view controller not call the - (void)viewDidAppear:(BOOL)animated method?

我是研究僧i 提交于 2019-12-12 06:13:47

问题


I want to do something in the viewDidAppear method but this method not auto calling the SDK describe this method is Notifies the view controller that its view was added to a window. if means implement this method in my view controller can auto calling?

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    ...
}

回答1:


It depends on how you add your view to the view hierarchy. If you push your controller on an navigation stack for example, this method will be called automatically. If however you add the view 'manually', for example using addSubview: then you yourself are responsible for calling this method on the controller.



来源:https://stackoverflow.com/questions/4719800/why-my-view-controller-not-call-the-voidviewdidappearboolanimated-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!