In order to initialize a view that has xib, I use initWithCoder
function. But what if I need to initialize the xib with custom parameter.
I need something like this:
- (id)initWithCoder:(NSCoder *)aDecoder
andTitle:(NSString *)titleString
{
self = [super initWithCoder:aDecoder];
if (self) {
self.titleLabel = titleString;
}
return self;
}
And when do I call it? After awakeFromNib
?