在表格视图的特定部分中设置按钮文本



我有一个表视图(tableview1(,它有一个带有标题和按钮的节标题。按钮已分配给节标题标记。

- (UIView *)mTableView:(TQMultistageTableView *)tableView viewForHeaderInSection:(NSInteger)section
{
//create uibutton 
btnParentoptntype.tag=section;
[btnParentoptntype addTarget:self action:@selector(btnParentClicked:) forControlEvents:UIControlEventTouchUpInside];
}

单击按钮后,会显示另一个tableview2(类似于下拉部分(。当在此表视图2中选择特定行时,按钮(在表视图1中(标题应使用该文本进行更新。当点击按钮时,我得到了分区索引

- (IBAction)btnParentClicked:(id)sender{

selectedParentChoice=[sender tag];
}

当下拉表视图(tableview2(中的值被选择时,我如何能够在tableview1中设置该特定部分的按钮文本

- (void)tableView:(UITableView *)theTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//How to set the button text of a particular section of tableview1
}

btnParentClicked:(id)sender中的发送方是一个按钮(eq.btnParentClicked:(UIButton *)sender(,因此可以将其注入tableview2的控制器中(或类似于selectedParentChoice存储在某个tmp变量中(,并在需要时直接更新标题。