//在选择行时,标题应该加1
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
NSArray *selectedRows = [self.thirdTableView indexPathsForSelectedRows];
NSString *titleFormatString = NSLocalizedString(@"Delete(%d)",@"Title for delete button with placeholder for number");
deleteButton.title = [NSString stringWithFormat:titleFormatString,selectedRows.count];
}
//在取消选择行的时候,标题应该减1
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(3_0){
NSArray *selectedRows = [self.thirdTableView indexPathsForSelectedRows];
NSString *titleFormatString = NSLocalizedString(@"Delete(%d)",@"Title for delete button with placeholder for number");
deleteButton.title = [NSString stringWithFormat:titleFormatString,selectedRows.count];
}
//效果如图