Objective C - Custom view and implementing init method?
I have a custom view that I want to be able to initialize both in-code and in nib . What's the correct way to write both initWithFrame and initWithCoder methods? They both share a block of code that is used for some initialization. The right thing to do in that case is to create another method containing the code that's common to both -initWithFrame: and -initWithCoder: , and then call that method from both -initWithFrame: and -initWithCoder: : - (void)commonInit { // do any initialization that's common to both -initWithFrame: // and -initWithCoder: in this method } - (id)initWithFrame:(CGRect