You can create a subclass of UITableViewCell, say CustomCell
. Create a xib file,add a UITableViewCell as root of xib. Change the identity of UITableViewCell
as CustomCell
. Connect outlets to the elements of CustomCell. But don't give ownership to any viewController.
Instantiate with following code in the tableView:cellForRowAtIndexPath:
in any viewController you want
CustomCell *customCell = [[NSBundle mainBundle]loadNibNamed:@"CustomCell"
owner:nil
options:nil][0];