title: App freezes when dismissing modal view controller on iPad
body: <p>This works on the iPhone BTW (Both running iOS 5.1)</p>
  
  <p>My app freezes when I call <code>[self dismissModalViewControllerAnimated:NO];</code></p>
  
  <p>I have tried many different approaches:</p>
  
  <p>My code how I have it now:</p>
  
  <pre><code>-(void) doneEditing:(NSString *)value
  {
      [multiLineText dismissModalViewControllerAnimated:NO];
      self.currentActiveTextView.text = value;
      self.currentActiveTextView = nil;
  }
  
  - (void)textViewDidBeginEditing:(UITextView *)textView
  {
      multiLineText = [[MultilineTextViewController alloc] init];
      multiLineText.delegate = self;
      multiLineText.text = textView.text;
      self.currentActiveTextView = textView;
      [self presentModalViewController:multiLineText animated:NO];
  }
  </code></pre>
  
  <p>MultilineTextViewController.h</p>
  
  <pre><code>@protocol DoneEditing
      -(void)doneEditing:(NSString*)value;
  @end
  
  @interface MultilineTextViewController : UIViewController
  {
      UITextView *inputText;
      id&lt;DoneEditing&gt; delegate;
  }
  @property (nonatomic, strong) NSString *text;
  @property (nonatomic, strong) id&lt;DoneEditing&gt; delegate;
  @end
  </code></pre>
  
  <p>Function called from a done button</p>
  
  <pre><code>-(void) done:(id)sender
  {
      [delegate doneEditing:inputText.text];
  }
  </code></pre>
  
  <p>I have tried dismissing the modal in my done function
  I have tried it in both places with self
  I have also tried this in <code>MultilineTextViewController</code></p>
  
  <pre><code>if ([[self parentViewController] respondsToSelector:@selector(dismissModalViewControllerAnimated:)]){
  
      [[self parentViewController] dismissModalViewControllerAnimated:NO];
  
  } else {
  
      [[self presentingViewController] dismissViewControllerAnimated:NO completion:nil];
  }
  </code></pre>
  
  <p>Just some history, when a user clicks a <code>UITextView</code> I use to open a new <code>ModalViewController</code> to allow the user more space to type large amounts of text, after completion the user presses done and I call the delegate method to put the text on the original form.</p>
  
  <p>If I change animated to yes in any of the above given cases it still doesn't work but instead of freezing I get the <code>NSInternalInconsistencyException</code> </p>
  
  <pre><code>Attempting to begin a modal transition from &lt;WorkflowViewController: 0xc6846b0&gt; to &lt;MultilineTextViewController: 0xc64b960&gt; while a transition is already in progress. Wait for viewDidAppear/viewDidDisappear to know the current transition has completed
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>I can't seem to find a reason for this thing not to work...</p>