objective c - iOS not able to update the set text in UITextField -
i have uitextfield
in uitableviewcell
text property 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 call,
nslog(@"%@", self.emailtextfield.text);
later in viewcontroller on press of button edited text still returns "test" while changed input value.
please help.
i think should implement uitextfield delegate method:
- (void)textfielddidendediting:(uitextfield *)textfield{ nslog(@"%@", textfield.text); }
here see textfield updated.
Comments
Post a Comment