我想在视图控制器中为 tableviewcell 加载我的自定义 xib。我无法在 tableview 中加载我的 xib
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:[CustomCell reuseIdentifier]];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
cell = _customCell;
_customCell = nil;
}
cell.topLabel.text = @"I am on top";
cell.bottomLabel.text = @"and I'm on the bottom";
return cell;
}
Run Code Online (Sandbox Code Playgroud)
我无法将我的自定义单元格从 xib 加载到 tableview 中。请帮我。