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 las开发者_如何学Got 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)];
}
精彩评论