Created
December 23, 2013 04:43
-
-
Save keicoder/8091731 to your computer and use it in GitHub Desktop.
objective-c : UiTableView Deleting rows (테이블 뷰 행 삭제)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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