开发者

UIView: Force viewDidLoad / A way to release an UIView?

开发者 https://www.devze.com 2022-12-25 13:20 出处:网络
Some important part of my code is running in viewDidLoad and I w开发者_开发技巧as wondering is there was a way to unload an UIView so that when my controller calls it again it must go through viewDidL

Some important part of my code is running in viewDidLoad and I w开发者_开发技巧as wondering is there was a way to unload an UIView so that when my controller calls it again it must go through viewDidLoad again?

Thanks a lot!


You should perhaps rethink the positioning of that code if its important.

If you need it to run each time the view is displayed, consider placing it in view[Will/Did]Appear.


Put those important part of code into -viewWillAppear:. -viewDidLoad is meant for initialization only.


You can also manually call -viewDidLoad or set the view property to nil.

0

精彩评论

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