当cell有xib文件时的初始化:
ClassifyMarkCell *cell=(ClassifyMarkCell *)[tableViewdequeueReusableCellWithIdentifier:@"ClassifyMarkCell"];
if(cell==nil){
NSArray *nib = [[NSBundlemainBundle] loadNibNamed:@"ClassifyMarkCell"owner:niloptions:nil];
cell=[nib objectAtIndex:0];
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
}
return cell;
当cell没有xib文件时的初始化:
MainClassifyCell *cell=(MainClassifyCell *)[tableViewdequeueReusableCellWithIdentifier:@"MainClassifyCell"];
if(cell==nil){
cell = [[MainClassifyCellalloc] initWithStyle:UITableViewCellStyleDefaultreuseIdentifier:@"MainClassifyCell"];
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
}
return cell;