本主题已遍布整个计算器,但我找不到合适的解决方案。UITableCell中的按钮 - 将数据传递给选择器
我在每个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;
}
这里是方法thah应处理按钮点击:
-(void)examinatonClicked:(MedicalExamination*)examination
{
}
我如何通过检查对象examinatonCommentsClicked
方法?显然,目标是对每个小区不同...
好,Dheerendra是有点权,是可以实现这样......不过我不认为厦门国际银行是必要的,只是定制UITableVIewClass –
是否有可能通过NSsstring这是全地球对象通过考试吗? –
或使用称为检查的新属性创建自定义的uitableviewcell。那是所有,而不是xibs。 – AndrewShmig