title: How To Get Selected Value From UIPickerView
body: <p>I know that with a UIDatePicker, you can use something like:</p>
  
  <pre><code>NSDate *myDate = picker.date;
  </code></pre>
  
  <p>But I am using a UIPickerView in my view.  How can i similarly get the value selected?  Or do I have to setup didSelectRow type of method to do this?</p>
  
  <p>Update:
  This code works for picker with 1 component:</p>
  
  <pre><code>NSInteger row;
  NSString *weightSelected;
  
  row = [repPicker selectedRowInComponent:0];
  weightSelected = [pickerArray objectAtIndex:row];
  </code></pre>
  
  <p>I tired this code for my picker with 2 components, but it is freezing:</p>
  
  <pre><code>NSInteger row1, row2;
  NSString *weightSelected1;
  NSString *weightSelected2;
  
  row1 = [repPicker selectedRowInComponent:0];
  row2 = [repPicker selectedRowInComponent:1];
  weightSelected1 = [pickerArray objectAtIndex:row1];
  weightSelected2 = [pickerArray objectAtIndex:row2];
  NSString *weightSelected = [NSString stringWithFormat:@"%@.%@", weightSelected1, weightSelected2];
  </code></pre>