这个问题遍及整个stackoverflow,但我找不到合适的解决方案。
我每个都有按钮UITableViewCell
。
这是我创建单元的方法。
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ExaminationCell"];
UIButton *clipButton = (UIButton *)[cell viewWithTag:3];
MedicalExamination *examination = [objects objectAtIndex:indexPath.row];
[clipButton addTarget:self action:@selector(examinatonClicked:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
这是应该处理按钮单击的方法:
-(void)examinatonClicked:(MedicalExamination*)examination
{
}
如何将检查对象传递给examinatonCommentsClicked
方法?显然,每个单元的对象是不同的...
我认为您必须先添加按钮,然后再uitableviewCell
通过xib(custum cell)
进行连接iboutlet
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句