Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 使用initWithCoder初始化UITableViewCell是否正确?_Iphone_Objective C_Uitableview_Nib - Fatal编程技术网

Iphone 使用initWithCoder初始化UITableViewCell是否正确?

Iphone 使用initWithCoder初始化UITableViewCell是否正确?,iphone,objective-c,uitableview,nib,Iphone,Objective C,Uitableview,Nib,我正在使用加载UITableViewCell [[NSBundle mainBundle] loadNibNamed:@"BlogCell" owner:self options:nil]; cell = blogCell; self.blogCell = nil; 其中,blogCell是blogCell.xib的出口 实际的UITableViewCell类型为BlogCell,它是UITableViewCell的子类 在我的BlogCell课程中,我正在使用 -(id)initWithCo

我正在使用加载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;
}
这是正确的吗?这是处理从nib加载的单元格初始化的方法吗


谢谢

,或者在
awakeFromNib