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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:29:49+00:00 2026-06-08T20:29:49+00:00

Anyone else getting this warning in Xcode 4.4? Case value not in enumerated type

  • 0

Anyone else getting this warning in Xcode 4.4?

Case value not in enumerated type ‘MessageComposeResult’ (aka ‘enum MessageComposeResult’)

MFMailComposeResultFailed is included in Result codes returned when the mail composition interface is dismissed in the documentation. However, the documentation lists it but the GCC warns it is NOT an enum within MessageComposeResult. Why?

    case MFMailComposeResultFailed:{
        //do something here
    }
        break;

Here is the expanded Method in which this case is called (I have commented this enum out to disable the warning):

- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result {

UIAlertView *errormsg = nil;
// Notifies users about errors associated with the interface
switch (result)
{
    case MFMailComposeResultCancelled:
    {
        //Do something, If you need to
        NSString *msgtitle = @"Cancelled Mail";
        NSString *Bodymsg = @"Email Has been Cancelled by USER. You may continue to make modifications to the current attendance data at this point.";
        errormsg = [[UIAlertView alloc] initWithTitle:msgtitle message:Bodymsg delegate:self cancelButtonTitle:@"Close" otherButtonTitles:nil];
    }
        break;
    case MFMailComposeResultSaved:{/*Do nothing at this point*/}
        break;
         //NOTE: MFMailComposeResultFailed is included in Result codes returned when the mail composition interface is dismissed. However the documentation lists it but the GCC warns it is NOT an enum within MessageComposeResult. May be an Apple Bug.
    /*case MFMailComposeResultFailed:{
        NSString *title = @"Unable to Send Mail";
        NSString *msg = @"Failed:\nmessage was not saved or queued, possibly due to an error.\nCheck your mail sent or draft items.";
        errormsg = [[UIAlertView alloc] initWithTitle:title message:msg delegate:self cancelButtonTitle:@"Close" otherButtonTitles:nil];
    }
        break;
       */  
    case MFMailComposeResultSent:{
        NSString *title = @"Mail Sent";
        NSString *msg = @"Attendance Email has been sent. Thank you.";

        errormsg = [[UIAlertView alloc] initWithTitle:title message:msg delegate:self cancelButtonTitle:@"Close" otherButtonTitles:nil];
        //clean up data
        //code here irrelevant
        //set a completed flag for sent email in system

        //display Alert and dismiss the mail composer view here
        UIAlertView *alertView = nil;

        if (result) {
            alertView = [[UIAlertView alloc] initWithTitle:@"AttendanceViewController: viewDidLoad" message:@"updateProgressOfClassInstance FAILED" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
        }
        if (alertView != nil) {
            [alertView show];
        }

    }
        break;
    default:
        break;
}
//dismiss view and display any errors here.
[self dismissModalViewControllerAnimated:YES];
if (errormsg != nil) {
    [errormsg show];
}

I hope this clarifies it for you guys. Thanks!

(UPDATE) Ok there were several issues with my code that I didn’t realize was there. I fixed them and here below is the resultant correct switch statement.

switch (result)
{
    case MessageComposeResultCancelled:
    {
        //Do something, If you need to!
    }
        break;

    case MessageComposeResultFailed:{
        //Do something else, If you need to!!
    }
        break;

    case MessageComposeResultSent:{
        //Do something user friendly, If you need to!

    }
        break;

    default:
        break;
}

Keep on rockin’ in the free world and on stackoverflow! Woot!

  • 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-06-08T20:29:51+00:00Added an answer on June 8, 2026 at 8:29 pm

    You are mixing up error codes. The result enum has the three values that you see working.

    The “MFMailComposeResultFailed” value is returned within the error of this delegate method:

    - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
    

    Look at the bottom of this deocumentation page:

    MFMailComposeViewController Class Reference
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone else come across this at all? I used to be able to
Has anyone else had this issue and found a working solution? I've enabled the
has anyone else experienced this . I have SP1 but i have to kill
Has anyone else experienced this? I have uninstalled and reinstalled TortoiseSVN as well as
Just wondering if anyone else has spotted this: On some user's machines running our
I am curious to see if anyone else has run into this same issue...
I am getting the Warning: Cannot modify header information . I am NOT getting
Does this rankle anyone else out there? I would much rather see: block.key(newKey); //
When i am Building this code i am getting WARNING that INVALID Integer to
Anyone else get this or suffer from this? I am using Vista and VS

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.