私は単純なtableViewを持っています。ラベル (左側) をタップすると、didSelectRowAtIndexPath が正常に起動します。右側(textField)をタップしても発火しません。
何が欠けているのかわかりません..セルを作成して選択するコードは次のとおりです。
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier];
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 150, 30)];
textField.delegate = self;
textField.returnKeyType = UIReturnKeyDone;
textField.borderStyle = UITextBorderStyleNone;
cell.accessoryView = textField;
textField.text = [NSString stringWithFormat:@"%d ", indexPath.row];
}
cell.textLabel.text = [NSString stringWithFormat:@"Line %d", indexPath.row];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"%s", __FUNCTION__);
currentIndexPath = indexPath;
NSLog(@"didSelect currentIndexPath.section is %i", currentIndexPath.section);
NSLog(@"didSelect currentIndexPath.row is %i", currentIndexPath.row);
}
すべての助けに感謝します。