title: How to reset UIPickerView to index:0,iPhone
body: <p>I am trying to reset the <code>UIPickerView</code> on button click.
  My pickerview id is created at runtime, I have delegates set already.
  After googling, I found </p>
  
  <pre><code>[pickerView reloadAllComponents];
  </code></pre>
  
  <p>But this makes my app crash everytime it reaches here.</p>
  
  <p>Object at index 0 is "Select from list" and then the items.
  When the submit button is clicked, I want that the "Select from list" should remain at the top of my label (selected index: 0).</p>
  
  <p>Here is my code</p>
  
  <pre><code>ViewDidload
  
   pickerView = [[UIPickerView alloc] init];
      pickerView.delegate = self;
      pickerView.dataSource = self;
  
    -(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
          return 1;
      }
  
  
   // Total rows in our component.
      -(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
          return [nameArray count];
      }
  
  // Display each row's data.
  -(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{
      return [nameArray objectAtIndex: row];
      }
  
  // Do something with the selected row.
  
      -(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
          dlbl.hidden=YES;
          NSLog(@"You selected this: %@", [nameArray objectAtIndex: row]);
          [btnSelectDesigner setTitle:[nameArray objectAtIndex: row] forState:UIControlStateNormal]; 
  
      }
  </code></pre>
  
  <p>and, on button click:</p>
  
  <pre><code>-(IBAction)btnSubmitClicked:(id)sender{
  [pickerView reloadAllComponents];
  }
  </code></pre>
  
  <p>Any idea what I'm doing wrong?</p>
  
  <p>Thanks</p>