您好我在Storyboard的 ControllerA 中创建了UITableViewCell。我需要在不同的 ControllerB 中使用相同的UITableViewcell。我只需要用故事板来实现这个目标。 知道我该怎么做呢?
答案 0 :(得分:1)
你可以像下面这样使用它: -
在故事板中你必须将另一个Table-cell放入ControllerB nib并为它提供类似自定义单元格的类名称,如下所示: -
和
你的ControllerB的cellForRowAtIndexPath
看起来像这样
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
Members_Cell *cell = [tableView dequeueReusableCellWithIdentifier:@"Members_Cell"];
cell.lblMemberName.text=[ArrSearchResult objectAtIndex:indexPath.row];
return cell;
}