8.x系统只有同时实现下面方法1和方法2才能响应tableView: editActionsForRowAtIndexPath:方法,9.x系统只用实现方法1就可以响应,两个方法都来自UITableViewDataSource。
// 方法1
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
return YES;
}
// 方法2
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath*)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
<#Code#>
}
}