I would want to create a custom tableviewcell which should have a different appearance than the default implementation. For this I subclassed the tableviewcell and want to add a label, textbox and a background image. Only the background image seems not to appear. Maybe I'm completely on the wrong track here and maybe subclassing a UItableViewCell is a bad idea after all, is there any reason why that would be the case and is there a better way?
Anyhow this is what I tried, in the subclass's initWithStyle I put the following:
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self == nil)
{
return nil;
}
UIImage *rowBackground;
backRowImage = [UIImage imageNamed:@"backRow.png"];
((UIImageView *)self.backgroundView).image = backRowImage;
}
What am I doing wrong here? Should I set the background image in the drawRect method as well?