I want to draw the background of a UITableViewCell which has a grouped style. The problem with me is I am not able to call the -(void)drawRect:(CGRect)rect
or I
I have to agree with Sbrocket.
You need two lines of code. Four lines if you want to use a custom color for the line separator and border.
// For cell background
cell.backgroundColor=[UIColor lightGrayColor];
// For tableView line separator (assuming IBOutlet UITableView* table;)
self.table.separatorColor=[UIColor redColor];
//If you need a custom color (I assume you do), then...
cell.backgroundColor=[UIColor colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha];
Drop in the RGB value for any color you like for both the cell background and line separator.
Couldn't be easier.