【问题标题】:Is it correct to initialise a UITableViewCell using initWithCoder?使用 initWithCoder 初始化 UITableViewCell 是否正确?
【发布时间】:2010-09-10 18:58:44
【问题描述】:

我正在使用 UITableViewCell 加载,

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

blogCell 是 BlogCell.xib 的出口

实际的 UITableViewCell 是 BlogCell 类型,它是 UITableViewCell 的子类。

在我使用的 BlogCell 类中

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

  //initialisation of some cell properties here

  return self;
}

这是正确的吗?这是您处理从笔尖加载的单元格初始化的方式吗?

谢谢

【问题讨论】:

    标签: iphone objective-c uitableview nib


    【解决方案1】:

    那个,或者awakeFromNib

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-09
      • 2013-08-05
      • 2016-01-23
      • 2014-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多