在 MFMessageComposeViewController 中点击取消后没有任何反应
尽管在使用 MFMailComposeViewController 后,可以直接转移到 MFMessageComposeViewController ,但有一个问题。
假设这段代码:
MFMessageComposeViewController* mySMS = [[MFMessageComposeViewController alloc] init];
[mySMS setDelegate:self];
[self presentModalViewController:mySMS animated:YES];
对于邮件来说,它是这样工作的,但是在短信中,您应该将不同的委托设置为这样的内部结构:
[SMS setMessageComposeDelegate:self];
希望您不会像我今天早些时候所做的那样陷入困境。
After though that after using MFMailComposeViewController
the move to MFMessageComposeViewController
was straight foward, but there is a catch.
Suppose this code:
MFMessageComposeViewController* mySMS = [[MFMessageComposeViewController alloc] init];
[mySMS setDelegate:self];
[self presentModalViewController:mySMS animated:YES];
It works this way for mails, but in sms you should set different the delegate to an internal structure like this:
[SMS setMessageComposeDelegate:self];
Hope you don not get stuck on this as I did early today.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要实现委托方法
-(void)mailComposeController(MFMailComposeViewController*)controller didFinishWithResult (MFMailComposeResult)result error:(NSError*)error:
在其中您应该自己关闭它:
You need to Implement the delegate method
-(void)mailComposeController(MFMailComposeViewController*)controller didFinishWithResult (MFMailComposeResult)result error:(NSError*)error:
And inside it you should dismiss it yourself:
您可以在 Apple 文档中看到 MFMailComposeResult
并且您必须在委托方法中自行关闭控制器
You can see MFMailComposeResult in Apple documentation
And you must dismiss controller by yourself in delegate method