Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think that you have something like this to setup your text field:</p> <pre><code> self.citys = @[@"Buenos Aires", @"Bahia Blanca", @"Azul",@"Pigue"]; self.namePicker = [[UIPickerView alloc] init]; self.namePicker.delegate = self; self.namePicker.dataSource = self; self.namePicker.showsSelectionIndicator = YES; self.accessoryView = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)]; UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(onNameSelection)]; [self.accessoryView setItems:[NSArray arrayWithObject:doneButton]]; self.textField.inputView = self.namePicker; self.textField.inputAccessoryView = self.accessoryView; </code></pre> <p>And something like this to set the text when the user finish the selection:</p> <pre><code>- (void) onNameSelection{ NSInteger row = [self.namePicker selectedRowInComponent:0]; self.textField.text = [self.citys objectAtIndex:row]; [self.textField resignFirstResponder]; } </code></pre> <p>So... You don't need the action EditingChanged, because you know when the <code>textfield.text</code> is changed.</p> <p>Maybe you also have something like this to change the text while the user select row in the picker:</p> <pre><code>- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{ self.textField.text = [self.citys objectAtIndex:row]; } </code></pre> <p>Again, you know when the <code>textfield.text</code> is changed. </p> <p>So... Because <strong>YOU</strong> are the responsible of the changes on the <code>textfield.text</code> <strong>YOU</strong> are the responsible of call the function associated to the EditingChanged action.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload