I have the following code that gets called in didSelectRowAtIndexPath. The issue is, when I click the cancel button, it prompts for save draft or discard. But when I click
There could be several problems:
Not adding protocol implemantation in the .h
@interface yourClass : UIViewController
Not adding the relevant function in .m:
-(void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult: (MFMailComposeResult)result error:(NSError*)error {
[self dismissModalViewControllerAnimated:YES];
}
My error was not setting the correct delegate, but I fixed it :) and now it works for me:
picker.mailComposeDelegate = self;