title: addTarget:action:forControlEvents - UISwitch in TableView - sender ok, event always 0x0
body: <p>Using the fantastic posts in this forum, I created a switch as a accessoryView in a tableView. When the switch is touched my action (switchChanged) is called. Only the sender has a valid value, the event is 0x0.</p>
  
  <p>Adding target to the switchView:</p>
  
  <pre><code>        [switchView addTarget:self action:@selector(switchChanged:forEvent:) forControlEvents:(UIControlEventValueChanged | UIControlEventTouchDragInside)];
  </code></pre>
  
  <p>The Action:</p>
  
  <pre><code>- (void) switchChanged:(id)sender forEvent:(UIEvent *)event {
    if(event) {
      NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:[[[event touchesForView:sender] anyObject] locationInView:self.tableView]];
      IFDFlightlogFormQuestions *question = [self.resultsController objectAtIndexPath:indexPath];
      NSLog(@"IFDNewFlightlogViewController_Pad:switchChanged Switch is %@ xmlAttrib %@",[sender isOn],question.XmlAttrib);
      [self.xmlResults setValue:([sender isOn])?@"true":@"false" forKey:question.XmlAttrib];
    }
  }
  </code></pre>
  
  <p>Using <code>action:@selector(switchChanged: forEvent:)</code> - Added space - no change.</p>
  
  <p>Using <code>action:@selector(switchChanged::)</code> - removed <code>forEvent</code> - unrecognized selector.</p>
  
  <p>My goal is to get the indexPath to the tableView so I can change the value in my dictionary.</p>
  
  <p>My current workaround is to use just the sender information, but I would like the event information:</p>
  
  <pre><code>- (void) switchChanged:(id)sender forEvent:(UIEvent *)event {
      UISwitch *switchView = (UISwitch *)sender;
      UITableViewCell *cell = (UITableViewCell *)switchView.superview;
      UITableView *tableView = (UITableView *)cell.superview;
      NSIndexPath *indexPath = [tableView indexPathForCell:cell];
      IFDFlightlogFormQuestions *question = [self.resultsController objectAtIndexPath:indexPath];
      NSLog(@"IFDNewFlightlogViewController_Pad:switchChanged Switch is %@ xmlAttrib %@",([sender isOn])?@"On":@"Off",question.XmlAttrib);
      [self.xmlResults setValue:([sender isOn])?@"true":@"false" forKey:question.XmlAttrib];        
  }
  </code></pre>
  
  <p>Any pointers on getting the event information on this?</p>