На самом деле вам не нужно создавать собственный класс.Если вы пишете для версии 4.0 и выше, вы можете использовать UINib для ее создания.Вы также можете кэшировать его для повышения производительности.
UIViewController.h
@property (nonatomic, retain) UINib *cellNib;
@property (nonatomic, retain) IBOutlet MyCustomTableViewCell *customCell;
UIViewController.m
- (void)viewDidLoad
{
[super viewDidLoad];
// Cache the tableviewcell nib
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;
}
// Set title and such
}
Не забывайте выпускать его в dealloc, если нетиспользуя ARC