MFMailComposeVC
I am using the MFMailComposeViewController
to let user send email within my app.
after create and show this system mail compose开发者_运维问答r with presentModalViewController
: i waited for the delegate call :
- (void) mailComposeController: (MFMailComposeViewController *)controller didFinishWithResult: (MFMailComposeResult)result error: (NSError *)error
in this delegate (which is also the only delegate i can find) method i close the mailComposerView.
Every thing works fine except when after user input some content but choose 'cancel' instead of 'send', there will be an system action sheet with option 'Save', 'Delete' and 'Cancel'. if user choose 'Save', which means save the mail draft, there will be a quite long time interval before the delegate method is called. thus, my UI looks like was hanging.
Another thing i obsereved is that if you put your app in backgorud during this hang-out the app get crashed on resume due to watchdog.(Not resumed in time)
This crash is also in the iOS native photo app if follow same steps.
Anyone have any idea how can i avoid this? or maybe any other solution that i can send email in app rather then using MFMailComposeViewController
?
I also had some issues with the MFMailComposeViewController
and because it is only used for feedback I finally decided to send the user of to the Mail app by using
NSString *recipientsAndSubject = [NSString stringWithFormat: @"mailto:%@?subject=%@", recipient, subject];
NSString *email = [NSString stringWithFormat:@"%@&body=%@", recipientsAndSubject, body];
email = [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]];
My issue was, that right after using the MFMailComposeViewController
, some scrolling within my VC became sluggish. This only happened if you clicked anything in the MFMailComposeVC. If you just left it deleting the draft, scrolling was fine...
精彩评论