title: View locked out after UIActionSheet or UIAlertView (iPhone / iPad)
body: <p>I'm having some trouble with either a <code>UIAlertView</code> or <code>UIActionSheet</code> stealing the focus and not letting go. </p>
  
  <p>To elaborate, I have a setup whereby a user presses a button. This then displays a <code>UIAlertView</code> with a UITextField. When the user presses the 'Ok' button a <code>UIActionSheet</code> is displayed (called from the <code>UIAlertView</code> delegate method) confirming something with the user. However when they press one of the buttons the <code>UIActionSheet</code> goes away but the focus doesn't get returned to the main view.</p>
  
  <p>I have been playing around and whatever I seem to do I always end up with my main <code>UIView</code> being covered with a layer like this (obviously you can seem my view through the layer). I have tried removing all subviews of the view but it didn't have any success.</p>
  
  <p><img src="https://i.stack.imgur.com/Q7GxQ.png" alt="enter image description here"></p>
  
  <p>Please can someone help me out?</p>
  
  <p>Here is the source code:</p>
  
  <pre><code>// This method displays the UIAlertView which contains a UITextView linked up to a
  // UIPickerView.
  - (IBAction)buttonPressed:(id)sender
  {
      UIAlertView *deleteAlert = [[UIAlertView alloc] initWithTitle:@"Delete Something" 
                                                            message:@"Select something to delete:" 
                                                           delegate:self 
                                                  cancelButtonTitle:@"Cancel" 
                                                  otherButtonTitles:@"Ok", nil];
      deleteAlert.alertViewStyle = UIAlertViewStylePlainTextInput;
      deleteAlert.tag = kDeleteAlert;
      deleteTextField = [deleteAlert textFieldAtIndex:0];
      [pickerView reloadAllComponents];
      deleteTextField.inputView = pickerView;
      [deleteAlert show];
  }
  
  
  // The UIAlertView delegate method is then used to display a UIActionSheet to confirm
  // whether the user wants to proceed.
  - (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)buttonIndex
  {
      UIActionSheet *confirmDelete = [[UIActionSheet alloc] initWithTitle:@"Delete blah?" 
                                                                 delegate:self 
                                                        cancelButtonTitle:@"No" 
                                                   destructiveButtonTitle:@"Yes" 
                                                        otherButtonTitles:nil];
      confirmDelete.actionSheetStyle = UIActionSheetStyleBlackOpaque;
      [confirmDelete showInView:self.parentViewController.tabBarController.view];
  }
  
  // Then the focus should be returned to the original view (i.e. where the first button
  // was pressed to launch the UIAlertView. However the focus is still locked and the
  // view appears slightly dimmed around the edges.
  -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex 
  {
      if (buttonIndex == actionSheet.destructiveButtonIndex) 
      {
          // Do some stuff ...
      }
  }
  </code></pre>