简体   繁体   English

UIViewController,情节提要,没有init方法

[英]UIViewController, storyboards, no init method

I am using storyboards, and I have one UIViewController that is being opened modally. 我正在使用情节提要,并且我有一个模态打开的UIViewController

When the UIViewController is being loaded, it never hits any of the init methods init , initwithcoder , or initwithnib . 加载UIViewController ,它永远不会命中任何initinitwithcoderinitwithnib的init方法。

Why not? 为什么不? I need to initialize some variables there!! 我需要在那里初始化一些变量!

答案是awakeFromNib,@ Fogmiester知道了,尽管不知道如何使其成为答案!!

you can use viewDidLoad function and it also call once for each control object. 您可以使用viewDidLoad函数,该函数还会为每个控件对象调用一次。

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM