I have an application in which I have two buttons on a tableView and the remaining as cells. I have been using backgroundimage view for my cells. like this `
UIImageView* img = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cell_with_arrow.png"]];
[cell setBackgroundView:img];
[img release];
then i am changing the selected background color as
UIView *violetColor = [[UIView alloc] init];
violetColor.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"trans.png"]];
cell.selectedBackgroundView = violetColor;
[violetColor release];
everything working fine for me in cells,but in my two cells I have added two buttons. when selecting and holding this button also I need to change my selected background color of the background cell in which that button is added. I was done it but the problem the cell background color is changing only when I am releasing my tap on the button. not when I am holding on to that button.I need to change that also when i am holding on to it. I am doing now like this
UIView *contentView = (UIView *)[sender superview];
UITableViewCell *cell = (UITableViewCell *)[contentView superview];
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
[self tableView:self.tableView didSelectRowAtIndexPath:indexPath];
in the button action. But in the cells when I am holding the color changes, not with button why? can anybody help me?