Add/remove image on button press
<p>This my tableview.i want when user press button then another image should on the top of that image and removed when again user presses wt is the code</p>

<pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    CGRect prescriptionFrame=CGRectMake(100, 0, 150, 40);
    UILabel *presTextLabel=[[UILabel alloc] initWithFrame:prescriptionFrame];
    presTextLabel.font=[UIFont boldSystemFontOfSize:20];

    CGRect tabletFrame=CGRectMake(150, 50, 100, 20);
    UILabel *tabletTextLabel=[[UILabel alloc] initWithFrame:tabletFrame];
    tabletTextLabel.font=[UIFont boldSystemFontOfSize:10];

    CGRect noOfTabletFrame=CGRectMake(250, 40, 30, 30);
    UILabel *noOfTabletTextLabel=[[UILabel alloc] initWithFrame:noOfTabletFrame];
    noOfTabletTextLabel.font=[UIFont boldSystemFontOfSize:10];

    cellButton = [UIButton buttonWithType:UIButtonTypeCustom];
    cellButton.frame=CGRectMake(10,10 ,50,50);      


    presTextLabel.text=[appDelegate.prescriptionArray objectAtIndex:indexPath.row];
    tabletTextLabel.text=[appDelegate.tabletArray objectAtIndex:indexPath.row];
    noOfTabletTextLabel.text=[appDelegate.noOfTabletsArray objectAtIndex:indexPath.row];

    [cellButton setImage:[appDelegate.imageArray objectAtIndex:indexPath.row] 
forState:UIControlStateNormal];

    [cellButton addTarget:self action:@selector(StartTimer) 
forControlEvents:UIControlEventTouchUpInside];

    cellButton.tag = indexPath.row;
    [cell.contentView addSubview:presTextLabel];   
    [cell.contentView addSubview:tabletTextLabel];   
    [cell.contentView addSubview:noOfTabletTextLabel];    
    [cell.contentView addSubview:cellButton];

    [presTextLabel release];  
    [tabletTextLabel release];
    return cell;
}
</code></pre>
