“-(id)init";使用情节提要时不要在ViewController中触发 [英] "-(id) init" do not fire in ViewController when using storyboard

查看:58
本文介绍了“-(id)init";使用情节提要时不要在ViewController中触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现使用情节提要时未执行ViewController中的-(id)init".有没有其他方法可以替代init,或者还有其他方法可以强制触发init.

I notice "-(id) init" in ViewController is not executed when using storyboard. is there any other method that could replace init, or is there is away to force firing init.

推荐答案

尝试使用

- (id)initWithCoder:(NSCoder*)aDecoder 
{
    if(self = [super initWithCoder:aDecoder]) 
 {
        // Do something
    }
    return self;
}

这篇关于“-(id)init";使用情节提要时不要在ViewController中触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆