应用程序中的电子邮件视图无法关闭 - iPhone OS 4

发布于 2024-11-10 05:48:56 字数 617 浏览 5 评论 0原文

我在添加用户向我自己(所述应用程序的制造商)发送支持电子邮件的功能时遇到困难。我已经让它工作得几乎完美,但是当您单击“取消”或单击“发送”时,视图不会关闭。感谢您的帮助!

这是代码:

 MFMailComposeViewController *mail = [[[MFMailComposeViewController alloc] init] autorelease];


        mail.mailComposeDelegate = self;

        [mail setToRecipients:[NSArray arrayWithObject:@"[email protected]"]];
        [mail setSubject:@"Fraction Calculator Lite Support"];    

        [self presentModalViewController:mail animated:YES];

I am having difficulties adding the ability for a user to send a support email to myself (the maker of said app). I have gotten it work almost perfectly however the view doesn't close when you click cancel, or when you click send. Thanks for the help!

Here is the code:

 MFMailComposeViewController *mail = [[[MFMailComposeViewController alloc] init] autorelease];


        mail.mailComposeDelegate = self;

        [mail setToRecipients:[NSArray arrayWithObject:@"[email protected]"]];
        [mail setSubject:@"Fraction Calculator Lite Support"];    

        [self presentModalViewController:mail animated:YES];

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

花伊自在美 2024-11-17 05:48:56

您将 self 设置为 MFMailComposeViewController 的委托。在 mailComposeController:didFinishWithResult:error: 中,请务必

[self dismissModalViewControllerAnimated:YES];

像这样调用:

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error 
{
    [self dismissModalViewControllerAnimated:YES];
}

You're setting self to be the MFMailComposeViewController's delegate. In mailComposeController:didFinishWithResult:error: be sure to call

[self dismissModalViewControllerAnimated:YES];

like so:

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error 
{
    [self dismissModalViewControllerAnimated:YES];
}
老旧海报 2024-11-17 05:48:56

您需要实现 MFMailComposeViewControllerDelegate 中的委托方法。

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
    [self dismissModalViewControllerAnimated:YES];
}

You need to implement the delegate method from MFMailComposeViewControllerDelegate.

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
    [self dismissModalViewControllerAnimated:YES];
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文