开发者

Which method is called when I return from navigation?

开发者 https://www.devze.com 2023-03-26 21:29 出处:网络
I want to do something when I push back button of navigation bar. In wh开发者_运维问答ich method do I have to do that?

I want to do something when I push back button of navigation bar. In wh开发者_运维问答ich method do I have to do that? viewDidUnload is not called. Do I have to do that in dealloc method?


-viewWillDisappear: and -viewDidDisappear will be called on the currently visible view controller. -dealloc may or may not be called depending on if the navigation controller was the only object retaining that view controller and it is therefore not an appropriate place for such logic. If the controller is not deallocated -viewDidUnload may be called at some point in the future if the controller receives a memory warning.

On the previous view controller on the navigation stack -viewDidLoad may be called if that controller's view has been unloaded and needed to be reloaded. viewWillAppear: and viewDidAppear: will be called.

On the navigation controller's delegate -navigationController:willShowViewController:animated: and -navigationController:didShowViewController:animated: will be called.


The viewWillDisappear & viewDidDisappear methods are called :)

0

精彩评论

暂无评论...
验证码 换一张
取 消