I have a UITextField
in UITableViewCell
the text property is not updating.
My tableview delegate:
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
KAPInputTableViewCell *cell = [self.registerTableView
dequeueReusableCellWithIdentifier:KAPInputCellIdentifier];
if (!cell) {
cell = [[KAPInputTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:KAPInputCellIdentifier];
}
switch (indexPath.row) {
case 0:
cell.inputTextField.placeholder = KAPLocalizedString(@"email", @"E-mail address");
cell.inputTextField.text = @"Test";
cell.tag = 0;
cell.errorLabel.text = self.emailError;
self.emailCell = cell;
self.emailTextField = cell.inputTextField;
break;
}
cell.inputTextField.delegate = self;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
Then when I call,
NSLog(@"%@", self.emailTextField.text);
Later in my ViewController on the press of a button the edited text still returns "Test" while I changed the input value.
Please help.
I think you should just implement the UITextField delegate method:
Here you will see your textField updated.