In fact, you do not need to create your own class. If you are coding version 4.0 or higher, you can use UINib to create it. You can also cache it for better performance.
UIViewController.h
@property (nonatomic, retain) UINib *cellNib;
@property (nonatomic, retain) IBOutlet MyCustomTableViewCell *customCell;
UIViewController.m
- (void)viewDidLoad
{
[super viewDidLoad];
self.cellNib = [UINib nibWithNibName:@"MyCustomTableViewCell" bundle:nil];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"MyCustomTableViewCell";
MyCustomTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
[self.cellNib instantiateWithOwner:self options:nil];
cell = customCell;
self.customCell = nil;
}
}
Do not forget about its release in dealloc if you do not use ARC