How to change cell background image on click on cell in iphone????I have tried following but it is not working….
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectMake(0,0,320,50) reuseIdentifier:myid] autorelease];
cell.selectedBackgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"myImage.png"]];
}
In the above piece of code you forget to autorelease; also have you set the delegate of the tableview? Set a breakpoint on the
tableview:didselectRowAtIndexpathmethod to check if it is called or not.BTW your code seems right.