Use the UINib class . It allows you to create instances without a parent, and also improves performance by caching the contents of the nib file.
@interface Class1 : UITableViewController<UITableViewDataSource, UITableViewDelegate> {
UINib *myCustomCellNib;
}
... and a similar thing for class 2. Then in viewDidLoad
myCustomCellNib = [UINib nibWithNibName:@"myCustomCellNibName" bundle:nil];
then when creating the cell:
NSArray* objects = [myCustomCellNib instantiateWithOwner:nil options:nil];
cell = [objects objectAtIndex:0];
source
share