How to delete the customized cell in UITableView ?

Discussion in 'iOS Programming' started by srikanthrongali, May 1, 2010.

  1. srikanthrongali macrumors newbie

    Joined:
    Apr 30, 2010
    #1
    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:

    Code:
    - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath   
     {
    return YES;
     }  
    
    
      - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 
    {
        if (editingStyle == UITableViewCellEditingStyleDelete)  
         {
         }
    }
    [​IMG]
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    You don't delete cells: you delete the objects in you data model and ask the view to reload. You can specifically ask it to reload specific rows with a fade animation if you want...
     

Share This Page