KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a subclass of UIView that's instantiated in a XIB file. I need it to do some initialization (settings some variables and creating a subview). However, I do not always instantiate this view via Interface Builder. I do it programmatically too. In both cases, the initialization needs to be the same. My designated initializer is initWithValues: . The question is; where do I perform the initialization? Since I have to perform it in 2 different locations, I figured I need to refactor it in a separate initialize method (or something like that), and call it from initWithValues: . But when loading from IB, both initWithCoder: and awakeFromNib are called. From which method do I have to call initialize ? Or do I have to call initWithValues: from initWithCoder: and do nothing in awakeFromNib ?
Tags (comma-separated)
Save Edits
Cancel