-(void)setMyCell:(id)cell atIndexPath:(NSIndexPath*)indexPath;
一些单元格是通用的UITableViewCellStyle类型,而另一些单元格则更复杂,为不同的部分加载NIB等。
[(CustomCell*) cell setMyTextLabel:@"text"];
对于通用单元格,标签称为“textLabel”。我想我可以做类似的事情
[(UITableViewCell*) cell setTextLabel:<new UILabel here>];
我试过了
(UITableViewCell*)cell.textLabel.text = @"text";
您是否尝试将类别添加到 UITableViewCell 使用标签更改方法,然后在中覆盖该方法 CustomCell ?
UITableViewCell
CustomCell