【发布时间】:2013-08-05 05:16:41
【问题描述】:
为了初始化一个有 xib 的视图,我使用了initWithCoder 函数。但是如果我需要使用自定义参数初始化 xib 怎么办。
我需要这样的东西:
- (id)initWithCoder:(NSCoder *)aDecoder
andTitle:(NSString *)titleString
{
self = [super initWithCoder:aDecoder];
if (self) {
self.titleLabel = titleString;
}
return self;
}
我什么时候调用它?在awakeFromNib之后?
【问题讨论】:
标签: ios objective-c xib