title: Handling the click on the UISegmentedControl
body: <p>In a <code>UITableViewCell</code> of the second section of my <code>UITableView</code>, i have defined a <code>UISegmentedControl</code> composed of two buttons:</p>
  
  <pre><code>if (indexPath.section == 1 &amp;&amp; indexPath.row == 0)
  {
      cell.selectionStyle = UITableViewCellSelectionStyleNone;
      cell.accessoryType = UITableViewCellAccessoryNone;
  
      allerRetour = [[UISegmentedControl alloc] initWithItems: [NSArray arrayWithObjects:NSLocalizedString(@"Y aller", nil),                                  NSLocalizedString(@"En partir", nil), nil]];
      [allerRetour setFrame:CGRectMake(9.0f, 0.0f, 302.0f, 45.0f)];
      allerRetour.selectedSegmentIndex = 0;
      [cell addSubview:allerRetour];
  }
  
  return cell;
  </code></pre>
  
  <p>Now, when i click on a button of that two buttons in the segmented control, i want to track that, so i try this in the <code>didSelectRowAtIndexPath</code> but it doesn't work (The NSLog is not displaying, so the event isn't thrown):</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      if(indexPath.section==1 &amp;&amp; indexPath.row==0)
      {   
          if (allerRetour.selectedSegmentIndex == 0)
          {
              labelModeRecherche.text=@"Départ"; 
              NSLog(@"Départ");
          }
          else
          {
              labelModeRecherche.text=@"Arrivée";   
              NSLog(@"Arrivée");
          }
      }
  }
  </code></pre>