title: uipickerview selection on tableviewcell detailtextlabel
body: <p>As I wrote in the title, I am trying to write down the value selected on a pickerview (populated by an array) to the <code>detailTextLabel</code> of the cell I clicked to bring up the pickerview. (The pickerview is shown in an actionSheet).</p>
  
  <p>What I tried to do was to set up two mutable arrays: <code>pickerData</code> and <code>tableData</code>. Initially, the <code>pickerData</code>array contains the values shown in the pickerview, and the <code>tableData</code> array has only one value. </p>
  
  <p>When the following method is called, I'm trying to record the selection onto the <code>tableData</code> array, and then use this value to replace the original value on the <code>detailTextLabel</code></p>
  
  <pre><code>- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
      [tableData replaceObjectAtIndex:row withObject:[pickerData objectAtIndex:row]];
  }
  </code></pre>
  
  <p>The <code>detailTextLabel</code> is populated by the <code>tableData</code> array, and this happens in the method:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  </code></pre>
  
  <p>using the line of code:</p>
  
  <pre><code>cell.detailTextLabel.text = [pickerData objectAtIndex:indexPath.row];
  </code></pre>
  
  <p>What am I doing wrong? any suggestions on how should I do this differently? I have been programming for only a month and I'm sure this has a simple solution. Thank You in advance!</p>