开发者

Is it correct to initialise a UITableViewCell using initWithCoder?

I am loading a UITableViewCell using,

[[NSBundle mainBundle] loadNibNamed:@"BlogCell" owner:self options:nil];
cell = blogCell;
self.blogCell = nil;

where blogCell is an outlet to BlogCell.xib

The actual UITableViewCell is of type BlogCell which is a subclass of UITableViewCell.

In my BlogCell class I am using

-(id)initWithCoder:(NSCoder *)aDecoder {
  self = [super initWithCoder:aDecoder];

  //initialisation of some cell properties here

  return self;
}

Is this correct? Is this the way you would tackle initialisation of a cell loaded from a nib?

Thanks开发者_运维百科


That, or in awakeFromNib.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜