Skip to content

Instantly share code, notes, and snippets.

@keicoder
Created December 23, 2013 04:43
Show Gist options
  • Save keicoder/8091731 to your computer and use it in GitHub Desktop.
Save keicoder/8091731 to your computer and use it in GitHub Desktop.
objective-c : UiTableView Deleting rows (테이블 뷰 행 삭제)
UiTableView Deleting rows (테이블 뷰 행 삭제)
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{

[items removeObjectAtIndex:indexPath.row]; //1. remove the item from data model:
NSArray *indexPaths = [NSArray arrayWithObject:indexPath];
[tableView deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationAutomatic]; //2. delete the corresponding row from the table view
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment