问题描述:

I have an edit button that when pressed puts the entire table into edit mode: tableView.editing=YES;

I want every cell to be in edit mode except for the last cell, which I want to remain in non-edit mode, always. Is there any way to do this?

网友答案:

Check it out!

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
   // this logic might work for you, or it mightn't if you have more than one section
   return [tableView numberOfRowsInSection:indexPath.section] != (indexPath.row + 1)];
}
相关阅读:
Top