UITableView: deleting sections with animation

后端 未结 7 1195
春和景丽
春和景丽 2020-12-02 05:39

Update

I have posted my solution to this problem as an answer below. It takes a different approach from my first revision.


Ori

相关标签:
7条回答
  • 2020-12-02 06:43

    or just do this

    - (void)tableView:(UITableView *)tv    
    commitEditingStyle:(UITableViewCellEditingStyle)editingStyle 
    forRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if(editingStyle == UITableViewCellEditingStyleDelete) {     
        //Delete the object from the table.
        [directoriesOfFolder removeObjectAtIndex:indexPath.row];
        [tv deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]  
    withRowAnimation:UITableViewRowAnimationFade];
    }
    }
    

    directories of folder being your Array! Thats is all above codes didnt work for me! This is less expensive to do and just makes sense!

    0 讨论(0)
提交回复
热议问题