title: UIPickerView data from Parse objects
body: <p>In my app I am showing a picker view to let the user select one object to populate a text field.
  When the user changes the picker row, the textfield should show the title of the picker row, but it doesn't happen always. 
  This is the code to get the source objects from Parse:</p>
  
  <pre><code>PFQuery *query = [PFQuery queryWithClassName:@"menu_categories"];
  [query whereKey:@"category_restaurant" equalTo:restauranteID];
  [query orderByDescending:@"createdAt"];
  [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
      if (!error) {
          _pickerData = objects;
  
          for (int i =0; i&lt; [objects count];i++)
          {
  
              NSString *textoactual = self.menu_item_category_textfield.text;
              if ([[[objects objectAtIndex:i] objectForKey:@"category_name"]
                   isEqualToString:textoactual])
              {
                  [self.room_picker reloadAllComponents];
                  [self.room_picker selectRow:i inComponent:0 animated:YES];
                  break;
  
              }
  
          }
  
      }
      else {
          NSLog(@"error");
      }
  } ];
  </code></pre>
  
  <p>I am using the for statement to make it possible that the picker row to be first shown is the same as the textfield content. That works fine.
  But later if the user changes the picker row, the row title name that should be shown as the textfield text doesn't change properly, sometimes it does, but sometimes it doesn't.</p>
  
  <p>These are the implemented picker view delegate methods:</p>
  
  <pre><code>- (int)numberOfComponentsInPickerView:(UIPickerView *)pickerView
  {
      return 1;
  }
  
  
  
  // The number of rows of data
  - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
  {
      return _pickerData.count;
  }
  
  
  - (NSString*)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
  {
      PFObject *object = _pickerData[row];
  
      self.menu_item_category_textfield.text = object[@"category_name"];
      return object[@"category_name"];
  
  
  
  }
  
  
  -(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row
        inComponent:(NSInteger)component
  {
  
  
  
  }
  </code></pre>
  
  <p>What should I change to obtain the desired behaviour, that means to show always the selected picker view row title as text in the textfield?</p>
  
  <p>EDITED:</p>
  
  <p><img src="https://i.stack.imgur.com/8rLpZ.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/cM8cC.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/3en6u.png" alt="enter image description here"></p>