Note that there are some explanatory texts on larger screens.

plurals
  1. POmodalViewController error. the strangest that I have ever encountered
    text
    copied!<p>I'm amused by a strange error that I'm encountering in my program.</p> <p>I have a <code>tableViewController</code> with a <code>navigationBar</code>. When the user clicks on an <code>ADD</code> button on the <code>navigationBar</code>, they're presented with a modal <code>tableViewController</code>. This <code>viewController</code> has a <code>CANCEL</code> button on its <code>navigationBar</code> (which dismisses the <code>viewController</code> via delegation)</p> <p>The <code>tableViewController</code> has custom cells containing <code>UIButton</code>s, a <code>UITextField</code> and a <code>UITextView</code>.</p> <p>The error is caused by following this sequence of actions (and no other):</p> <ul> <li>I type some text into the <code>UITextView</code> (which is located in one of the cells)</li> <li>Without dismissing the keyboard, I then scroll the <code>tableView</code> upwards.</li> <li>I hit the cancel button (so that the modal view controller is dismissed)</li> <li>Back in the main <code>tableViewController</code>, I tap the <code>ADD</code> button again, </li> </ul> <p>I get the <code>exec_bad_access</code> error.</p> <p>Nothing else causes this error. </p> <p>If I try exactly the same procedure but with the <code>UITextField</code> instead, things are fine. </p> <p>Also if I exclude any of the listed steps from the above sequence, things are fine.</p> <p>I'm pretty confused. Could it be a bug?</p> <hr> <h2>Update</h2> <p>I tried using <code>NSZombie</code> to figure out what's causing the error. This is what I see in the console:</p> <pre><code>MyApp[14402:207] *** -[UIWebDocumentView isKindOfClass:]: message sent to deallocated instance 0x200a800 </code></pre> <p>I don't have much code for this; the cells are created in interface builder. Here's the method which brings up the <code>modalViewController</code></p> <pre><code>- (void)createNewEntry:(id)sender { CreateNewEntryViewController *createNewEntryVC = [[CreateNewEntryViewController alloc] initWithNibName:@"CreateNewEntryViewController" bundle:nil]; createNewEntryVC.delegate = self; UINavigationController *createNewEntryNavigationController = [[UINavigationController alloc] initWithRootViewController:createNewEntryVC]; [createNewEntryVC release]; [self presentModalViewController:createNewEntryNavigationController animated:YES]; [createNewEntryNavigationController release]; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload