简体   繁体   中英

MessageComposeResultFailed When this case fire below code

For these below code i am not understanding the MessageComposeResultFailed case. when these case fire

- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult) result
{
    switch (result)
    {
        case MessageComposeResultCancelled:
            break;

        case MessageComposeResultFailed:
            {
                UIAlertView *warningAlert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Failed to send SMS!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
                [warningAlert show];
                break;
            }

        case MessageComposeResultSent:
            break;

        default:
            break;
    }

    [self dismissViewControllerAnimated:YES completion:nil];
}

MessageComposeResultFailed will be fired when the user's attempt to save or send the message was unsuccessful. You can refer documentation for more details. https://developer.apple.com/library/prerelease/ios/documentation/MessageUI/Reference/MFMessageComposeViewController_class/index.html#//apple_ref/c/tdef/MessageComposeResult

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM