ios - Which "init" method does segue call on UIViewController? -
bear me here, when link 1 uiviewcontroller
1 segue, "init" method segue use initiate new uiviewcontroller
? "initwithcoder" ? or else? need know because need modify init method segue uses initiate uiviewcontroller
.
thoughts?
it method
initwithcoder
i think solution better write common code in
-(void)setup{ //set }
then put code in every initmethod:
-(instancetype)initwithcoder:(nscoder *)adecoder{ if (self = [super initwithcoder:adecoder]) { [self setup]; } return self; } -(instancetype)init{ if (self = [super init]) { [self setup]; } return self; } //also other init method
Comments
Post a Comment