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 6896379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:02:00+00:00 2026-05-27T07:02:00+00:00

I have a utility app. I’ve implemented this code on the flipside, which calls

  • 0

I have a utility app. I’ve implemented this code on the flipside, which calls a Feedback view to send an email, like this tutorial. This works, but then when I click on the Send Feedback UIButton, my app immediately crashes with *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController sendMail]: unrecognized selector sent to instance 0x89c1960'.

I’ve checked these things:

I’ve declared the delegate properly and implemented it for the MailComposer.

My method, sendMail, is wired to the TouchUp Event for the button.

My method names agree:

- (IBAction)sendMail;

and

- (IBAction)sendMail 
{
if ([MFMailComposeViewController canSendMail]) 
{
    MFMailComposeViewController *mfViewController = [[MFMailComposeViewController alloc] init];
    mfViewController.mailComposeDelegate = self;

    [self presentModalViewController:mfViewController animated:YES];

}
else 
{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Status:" message:@"Your phone is not currently configured to send mail." delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil];

    [alert show];
}

}

The code doesn’t event get to this method because I have a breakpoint set at the top of the method implementation but doesn’t get called. Nor did a breakpoint at ViewDidLoad get activated.

Looking at this error closely:

reason: '-[UIViewController sendMail]: unrecognized selector sent to instance 

it seems it is expecting a view controller named sendMail rather than a method. I read this post which seems very similar but I dont’ see any other view controller names in the xib Identity drop down list. I think this is part of my problem but I’m not sure how to fix it.

Maybe I’m supposed to be presenting the MFMailComposer via a viewcontroller? If so, I’m not sure how to do that.

Any suggestions would be appreciated.

  • 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-27T07:02:01+00:00Added an answer on May 27, 2026 at 7:02 am

    You incorrectly assigned the type UIViewController to your custom view-controller. You should select the class-type that actually applies to your custom view-controller (the one that holds the method implementation sendMail).

    The problem with your code / setup is that your custom view controller gets instantiated with the type UIViewController. But, UIViewController does not implement any method called sendMail, hence you get an exception.

    As you are not specifying the class name of your custom view controller, I will simply assume one for the sake for this answer; MyCustomViewController

    Since you appear to use the InterfaceBuilder for setting those things up, use it to change the type of your view-controller towards MyCustomViewController.

    enter image description here

    EDIT

    From your comments, I can see that you actually instantiate the view controller using code. In that case, replace your way with this:

    MyCustomViewController *controller = [[MyCustomViewController alloc] initWithNibName:@"ExMobSendFeedback" bundle:nil]; 
    controller.title = @"Feedback"; 
    [self.navigationController pushViewController:controller animated:YES];
    [controller release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this application I made on a utility based app. How would I
I have an app based on the Utility template (i.e. Main and Flip view
I'm scratching my head over this. I have a moderately successful app which has
I have an app which is based on the Utility template (where you flip
I've got a Utility Application for iPhone 3.1.3. I have my main view loading
I have an app that sends upwards of 1,000 emails to clients. Each email
I have a google maps app which plots markers as it loads. One of
I have some utility functions like: void myVibratePhone() { AudioServicesPlaySystemSound (kSystemSoundID_Vibrate) ; } that
As the title suggests, I have built an utility based app. The app consists
I have a small utility script written as .Net/C# console app purely for the

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.