MFMessageComposeViewController not calling its delegate method

ios, iphone, mfmessagecomposeviewcontroller, objective-c, xcode

Solution

You have to set the `mailComposeDelegate`

    message.messageComposeDelegate = self;

Problem

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.

Original source