Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6193213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:04:48+00:00 2026-05-24T03:04:48+00:00

In my app, I have email sending code. It’s quite plain-vanilla (pasted at end

  • 0

In my app, I have email sending code.

It’s quite plain-vanilla (pasted at end of question).

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:

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'

What I notice is the following:
1. As I type the the To address, the debugger output shows CPSqliteStatementSendResults: interrupted
2. If I add a setToRecipients (effectively “hard-coding” the To email address), the application doesn’t crash…

Any ideas? (code below)

- (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];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:04:49+00:00Added an answer on May 24, 2026 at 3:04 am

    Try not to release the MFMailComposeViewController immediately but in his delegate method didFinishWithResult (at the very end).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web app (.NET 3.5) which is sending notifications by email to
Im working on a bulk email sending app and have a page with a
I have gotten quite familiar with django's email sending abilities, but I havn't seen
I have code for sending email to clients. System.Net.Mail.SmtpClient Client = new System.Net.Mail.SmtpClient(); MailMessage
I have mvc web app sending an email when new user gets created with
I have an app which is sending data collected via an email as an
I have an asp.net app that is sending out an email. Within the email,
i have an app that sends out email but i have to only send
I have been asked to implement some email address validation on a web app
I can't send email to my app users, even though I have the permissions.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.