如何在不同的UItableViewController中重用在Storyboard中创建的UITableViewCell视图?

Rom*_*zak 5 mobile objective-c storyboard uitableview ios

嗨,我在Storyboard 中的ControllerA中创建了UITableViewCell .我需要在不同的ControllerB中使用相同的UITableViewcell .我只需要用故事板来实现这个目标.知道我该怎么做?

Nit*_*hel 1

你可以像下面这样使用它:-

在故事板中,您必须将另一个表单元格放入 ControllerB 笔尖中,并为其指定与自定义单元格类似的类名称,如下所示:-

在此输入图像描述

在此输入图像描述

你的 ControllerBcellForRowAtIndexPath看起来像这样

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

    Members_Cell *cell  = [tableView dequeueReusableCellWithIdentifier:@"Members_Cell"];

    cell.lblMemberName.text=[ArrSearchResult objectAtIndex:indexPath.row];

    return  cell;

}
Run Code Online (Sandbox Code Playgroud)