开发者

Modal view controllers calling other's "viewDidLoad"

开发者 https://www.devze.com 2023-01-21 11:16 出处:网络
I have a bunch of pages I am chaining together and presenting as modal view controllers. THey all have viewDidLoad methods. It seems that when one is loaded though it calls the viewDidLoad methods of

I have a bunch of pages I am chaining together and presenting as modal view controllers. THey all have viewDidLoad methods. It seems that when one is loaded though it calls the viewDidLoad methods of ones in the background too. How can I stop t开发者_如何学JAVAhis? Thanks!


You can't. The viewDidLoad method will get called when the view is loaded. Asking a view controller for its view loads the view.

Consider moving code into your viewWillAppear:(BOOL)animated method. That way it will only get called before the view is actually shown to the user.

0

精彩评论

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