The init
methods (yes there is more then one) are where the UIViewController
is initialized. Thus this is the place where you do stuff for the UIViewController
and not its views.
If you use a nib
to load you view then the best place to set any properties is the viewDidLoad
method. This method gets called after the nib
is loaded.
If you set up the view programatically use the loadView
method then this is the place to set UIControl
properties.
Since the system can unload views to save memory, it will leave the UIViewController
alone. Any properties set in the init
methode will not be applied again, since the UIViewController
is already initialized.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…