【发布时间】:2013-12-16 12:47:47
【问题描述】:
我正在尝试将文本从 UITableViewCell 选择传递到 UITextField。
我的didSelectRowAtIndex 是这样设置的
#pragma mark -- select row
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];
NSLog(@"%@", selectedCell.textLabel.text);// shows correct values
currentSelected.text = selectedCell.textLabel.text; // currentSelected is defined below
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
这是我的表格视图选择,如您所见,我正在尝试将文本传递给 currentSelected UITextField 但是什么都没有发生..
这就是我设置当前选择的方式
#pragma mark - TextField delegates
- (void)textFieldDidBeginEditing:(UITextField *)textField {
currentSelected = textField;
}
【问题讨论】:
标签: ios uitableview uitextfield