Unexplained crash AFTER sending an email using MFMailComposer
<p>In my app, I have email sending code.</p>

<p>It's quite plain-vanilla (pasted at end of question).</p>

<p>What happens is the following sequence:
- Click the "EMAIL" button of my app, that calls the sendEmail method
- Click the To field
- Type an email address
- Click the MFMailComposer Send button
- The email is sent (and arrives - I typically set my own email address)
- The application crashes... with this stack crawl:</p>

<pre><code>2011-07-25 11:21:21.179 MyApp[2769:3d0b] -[__NSCFString searchQuery:returnedResults:]: unrecognized selector sent to instance 0x3c3410
2011-07-25 11:21:21.201 MyApp[2769:3d0b] uncaughtExceptionHandler
2011-07-25 11:21:21.202 MyApp[2769:3d0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString searchQuery:returnedResults:]: unrecognized selector sent to instance 0x3c3410'
</code></pre>

<p>What I notice is the following:
1. As I type the the To address, the debugger output shows <strong>CPSqliteStatementSendResults: interrupted</strong>
2. If I add a <em>setToRecipients</em> (effectively "hard-coding" the <em>To</em> email address), the application doesn't crash...</p>

<p>Any ideas? (code below)</p>

<pre><code>- (void)sendEmail:(id)sender {
    MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
    controller.mailComposeDelegate = self;

    [controller setSubject:@"The Subject"];

    [self presentModalViewController:controller animated:YES];
    [controller release];
}

- (void)mailComposeController:(MFMailComposeViewController*)controller  
          didFinishWithResult:(MFMailComposeResult)result 
                        error:(NSError*)error;
{
    switch (result)
    {
        case MFMailComposeResultCancelled:
            break;
        case MFMailComposeResultSaved:
            break;
        case MFMailComposeResultSent:
            break;
        case MFMailComposeResultFailed:
            NSLog(@"Sending Failed");
            break;
        default:
            NSLog(@"Message not sent");
            break;
    }
    [self dismissModalViewControllerAnimated:YES];
}
</code></pre>
