Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MFMessageComposeViewController not calling its delegate method

Hi i'm using MFMessageComposeViewController to send sms in my iOS project my code is like below,

 MFMessageComposeViewController *message = [[MFMessageComposeViewController alloc] init];
    message.delegate = self;
    message.recipients = [NSArray arrayWithObject:@"xxxxxx"];
    message.body = @"blha blah,,,,";
    [self presentModalViewController:message animated:YES];

and in my code i'm defining MFMessageComposeViewControllerDelegate method didFinishWithResult but when the task is completed control is not calling this didFinishWithResult delegate method.What may be the problem?

Any help is appreciated in advance.

like image 902
Graham Bell Avatar asked Dec 01 '22 05:12

Graham Bell


1 Answers

You have to set the mailComposeDelegate

    message.messageComposeDelegate = self;
like image 152
MCKapur Avatar answered Dec 04 '22 07:12

MCKapur