Pushing a navigation controller is not supported when using MFMessageComposeViewController

sanjeet picture sanjeet · Jul 3, 2014 · Viewed 7.9k times · Source

i am geeting crash using this code

Pushing a navigation controller is not supported

 MFMessageComposeViewController *messageController = [[MFMessageComposeViewController alloc] init];
    messageController.messageComposeDelegate = self;
    [messageController setRecipients:recipents];
    [messageController setBody:message];
    [self.parentViewController presentViewController:messageController animated:YES completion:nil];

Answer

amit soni picture amit soni · Jul 3, 2014
[self presentViewController:messageController animated:YES completion:nil];