在UITableview Row中传递IBAction按钮方法的值

我有一个名为member id的值,我想将它发送到另一个视图控制器,如果我将以下内容放在didSelectRowAtIndexPath中,该值将传递给变量“member”。
int memberIndex = [indexPath indexAtPosition: [indexPath length] - 1];
    member = [[tableDataSource2 objectAtIndex: memberIndex] objectForKey:@"Memberid"];
如果将它放在cellForRow中,当然它会在创建的每一行中重写。我在每一行都有一个启动viewController的按钮,我希望按钮动作抓取行“member”并将其传递给新控制器。在索引路径方法中是否有“didSelectButton”或者是在运行中获取它的方法? 任何想法都会很棒。这是我第一次在UiTableview上添加按钮。 谢谢     
已邀请:
为什么不使用配件视图?它是一个内置按钮,您可以使用任何想要为UI提供任何所需图像的图像。然后将其添加到表的委托中:
accessoryButtonTappedForRowWithIndexPath: (NSIndexPath *) indexPath{ ... }
然后,您就可以在表数据源上调用方法并启动辅助视图。     
只需玩“标签”。 每个UIView都有一个属性标记(int)。 在cellForRowAtIndexPath中:
//create yourButton and then
yourButton.tag = memberIndex;
当您使用IBAction时,只需获取发件人:
- (IBAction) didSelectButton:(id)sender
{
int memberIndex = ((UIButton *)sender).tag;
//
}
提示:在设置按钮的操作属性时获取发件人不要忘记“:” 例如
action = @selector(didSelectButton:);
    

要回复问题请先登录注册