不能通过点击UITextVIew中的邮件链接显示MFMailComposeViewController(iOS 8 beta bug)
这原来是由于在iOS 8testing版中的错误。 我已经通过错误号17318153报告
我正在设置一个电子邮件地址到UITextField。 目的是让iOS看到它的一个电子邮件地址,如果用户点击它,显示一个MFMailComposeViewController
的实例发送一个电子邮件(它)。
但是,如果用户点击取消, MFMailComposeViewController
不会被解雇。 我试图设置我的viewController作为MFMailComposeViewControllerDelegate
和覆盖mailComposeController: didFinishWithResult: error:
但它没有被调用。 表面上看,当点击url时显示的MFMailComposeViewController的委托没有被设置为self。
如何使MFMailComposeViewController
的取消button实际上closures显示的视图控制器?
我的.h:
#import <UIKit/UIKit.h> #import <MessageUI/MessageUI.h> @interface AboutUsViewController : UIViewController<MFMailComposeViewControllerDelegate>{ IBOutlet UIImageView *imageView; IBOutlet UITextView *companyName; IBOutlet UITextView *phoneNumber; IBOutlet UITextView *emailAddress; IBOutlet UITextView *aboutUsField; } @end
在.m中:
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. emailAddress.text=@"support@email.com"; } - (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error { switch (result) { case MFMailComposeResultCancelled: NSLog(@"Mail cancelled"); break; case MFMailComposeResultSaved: NSLog(@"Mail saved"); break; case MFMailComposeResultSent: NSLog(@"Mail sent"); break; case MFMailComposeResultFailed: NSLog(@"Mail sent failure: %@", [error localizedDescription]); break; default: break; } // Close the Mail Interface [self dismissViewControllerAnimated:YES completion:NULL]; }
这是一个已知的iOS8 beta 1问题。 确保打开一个与苹果公司的错误报告,并在这里发布错误报告号码,以便人们可以复制。
- HTML电子邮件丢失在iPhone上太长时间格式化
- 在UIDocumentInteractionController中定制“电子邮件”操作
- UIActivityView附加文件到电子邮件
- 移动Safari / iPhone Mail.app HTMLdevise问题:防止自动链接和样式自动链接(date,地址等)
- 如何使用Gmail api快速发送电子邮件
- Swift尝试呈现其视图不在窗口层次结构中的UIAlertController(在TWTRShareEmailViewController之后呈现)
- 如何使用Mailgun在Swift中发送电子邮件
- URL计划附件Microsoft Outlook应用程序
- HTML邮件中的尴尬超链接生成