ios - What init method is called when creating a UITextField in storyboard -


the question: subclassed uitextfield "uiselectfield" override delegate. created uitextfield in storyboard , changed class uiselectfield in identity inspector. however, default init method provided xcode, "initwithframe", not called. init method gets called when creating uitextfield approach?

the reason: right now, set delegate in view controller's init: [self.textfield setdelegate:self.textfield];. remove , replace [self setdelegate:self]; in whatever init method gets called. please tell me if there more elegant approach.

- (id)initwithcoder:(nscoder *)adecoder {     self = [super initwithcoder:adecoder];     if (self) {         // custom implementation     }     return self; } 

Comments