Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How reuse UITableViewCell view which is created in Storyboard in different UItableViewController?

Hi I created UITableViewCell in ControllerA in Storyboard. I need use the same UITableViewcell in different ControllerB. I need achive this only with storyboard. Any idea how can I make it?

like image 859
Roman Barzyczak Avatar asked Nov 11 '22 23:11

Roman Barzyczak


1 Answers

you can use this like bellow :-

in story board you have to put another Table-cell into ControllerB nib and give it class name that you want to similar custom cell like bellow:-

enter image description here

and

enter image description here

and your ControllerB 's cellForRowAtIndexPath look like this

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

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

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

    return  cell;

}
like image 166
Nitin Gohel Avatar answered Nov 15 '22 05:11

Nitin Gohel