實現該接口..
// 單
- (UITableViewCellEditingStyle)tableView:(UITableView *)tv editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
return UITableViewCellEditingStyleDelete;
//不能是UITableViewCellEditingStyleNone
}
點擊刪除按鈕后, 會觸發如下事件. 在該事件中做響應動作就可以了
- (void)tableView:(UITableView *)tableView
commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
}