本主題已遍佈整個計算器,但我找不到合適的解決方案。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