当前位置: 动力学知识库 > 问答 > 编程问答 >

iphone - Exclude UITableViewCell from editing

问题描述:

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)];
}
分享给朋友:
您可能感兴趣的文章:
随机阅读: