How to delete a cell in UITableView by using custom button in cell ?

Posted by srikanth rongali on Stack Overflow See other posts from Stack Overflow or by srikanth rongali
Published on 2010-04-30T14:12:25Z Indexed on 2010/05/01 9:17 UTC
Read the original article Hit count: 217

I have UITableView. I customized the cell height (increased).
I have 4 labels(UILabel) and 1 image(UIImage) and 3 buttons (UIButton). one of the button is delete button. By touching the cell or button(play button) on the image a video is loaded and played.

I need to delete the cell by touching delete button. If I touched the delete button the corresponding video is deleted from library . But, how to delete the cell and all remaining data in it ? I am not able to delete the cells or the data in the cells.

How to do it ? I used these. But the control is not entering in to second method committedEditingStyle:

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath   
 {
return YES;
 }  


  - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 
{
    if (editingStyle == UITableViewCellEditingStyleDelete)  
     {
     }
}

Thank you. The following image shows the delete button of my program.

alt text

© Stack Overflow or respective owner

Related posts about cocoa-touch

Related posts about iphone-sdk