title: EXC_BAD_ACCESS When Trying To Delete TableView Section
body: <p>I have a tableview with several sections. At a certain point, I want to delete a section from the tableView. To do this, I have a long-tap gesture on the headers, and on the long tap I bring up a UIMenuController like so:</p>
  
  <pre><code>UIMenuController *deleteMenu = [UIMenuController sharedMenuController];
  UIMenuItem *delete = [[UIMenuItem alloc] initWithTitle:@"Delete"     action:@selector(deleteCell:)];
  [deleteMenu setMenuItems:[NSArray arrayWithObject:delete]];
  [deleteMenu update];
  [deleteMenu setTargetRect:CGRectMake(0, 0, 320, 460) inView:self.superview];
  [deleteMenu setMenuVisible:YES animated:YES];
  </code></pre>
  
  <p>This is done in my custom view subclass for the headers. in the <code>deleteCell:</code> method, I call a delegate method (the delegate being the view controller that owns the tableview).
  In the implementation of the delegate method, I try to delete a section like so (section being an int):</p>
  
  <pre><code>[statsTable deleteSections:[NSIndexSet indexSetWithIndex:section] withRowAnimation:UITableViewRowAnimationAutomatic];
  </code></pre>
  
  <p>At this line, I get an EXC_BAD_ACCESS. The weird thing is, Xcode also crashes right when this happens, so I am not able to see the cause for the BAD_ACCESS. If anybody knows why this is happening, your help would be greatly appreciated.</p>
  
  <p>Thanks,</p>
  
  <p><strong>EDIT::</strong> Found the solution, the vc that has the tableview has to become the first responder in order for it to allow you to delete something from the tableview. Thanks </p>