title: How to populate data into Multiple UIPickerView?
body: <p>I have two fields that call UIPickerView (Country and Province). I'm using inputView to show the picker view. Both using one picker view but how do I populate based on the field?</p>
  
  <p><strong>Here I put sample code</strong></p>
  
  <p>This code get executed after picker view events! Someone suggest me to put this code in wright place.</p>
  
  <pre><code>-(void)textFieldDidBeginEditing:(UITextField*)textField;
  {
  // Check if the field is Country
  if (textField.tag == 3) {
      pickerData = [[NSMutableArray alloc] init];
      [pickerData addObject:@"Australia"];
      [pickerData addObject:@"Canada"];
      [pickerData addObject:@"India"];
      [pickerData addObject:@"China"];
      [pickerData addObject:@"United States"];
      [pickerData addObject:@"United Kingdom"];
      [pickerData addObject:@"New Zealand"];
  
      txtCountry.inputView = picker;
      picker.hidden = NO;
  }
  
  // Check if the field is Province
  else if (textField.tag == 4) {
      if ([[txtCountry text] isEqualToString: @"Canada"]) {
          pickerData = [[NSMutableArray alloc] init];
          [pickerData addObject:@"Quebec"];
          [pickerData addObject:@"Ontario"];
          [pickerData addObject:@"British Columbia"];
          [pickerData addObject:@"Prince Evard Island"];
          [pickerData addObject:@"Alberta"];
          [pickerData addObject:@"Sascatchwan"];
  
          txtProvince.inputView = picker;
          picker.hidden = NO;
      }
      else {
          txtProvince.inputView = nil;
          picker.hidden = YES;
      }
  }
  else {
      picker.hidden = YES;
  }
  }
  </code></pre>