获取 MFMailComposeViewController 中的收件人列表
我在我的应用程序中使用 MFMailcomposerViewController。一切工作正常,除了我需要有没有。收件人以及用户发送邮件的收件人列表。 有关此问题的任何帮助或解决方案..
I am using MFMailcomposerViewController in my App. Everything is working fine, except that I am in need to Have the no. of recipients and the list of recipients the user is sending to.
Any help or solution regarding this issue..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我没有标准方法来执行此操作,委托方法
mailComposeController:didFinishWithResult:error:
在 Compose 视图控制器被关闭后为您提供对它的引用,但是上没有访问器>MFMailComposeViewController
您可以使用它来获取收件人计数解决方法是检查视图控制器的子视图,找到用于保存收件人的文本字段并获取文本:请参阅 此处
I dont there is a standard way to do this, the delegate method
mailComposeController:didFinishWithResult:error:
gives you a reference to the composer view controller after it has been dismissed, but there are no accessors onMFMailComposeViewController
which you could use to get the recipient countA workaround would be to examine the subviews of the view controller, find the text field which was used to hold the recipients and get the text: see here
最后我得到了答案并想分享它......我从[博客]获得了很大的帮助:http://jomnius.blogspot.com/2011/02/how-to-find-mfmailcomposeviewcontroller.html
Finally I got the Answer and wanted to share it... I took a great help from [blog]: http://jomnius.blogspot.com/2011/02/how-to-find-mfmailcomposeviewcontroller.html
从 iOS 6 开始,无法执行此操作,因为邮件撰写现在是通过对远程进程 (MailCompositionService) 的 XPC 服务调用来完成。这里有一个很好的解释: http://oleb .net/blog/2012/10/remote-view-controllers-in-ios-6/。视图层次结构中的最低级别现在是与远程进程交互的 _UIRemoteView。博客文章中的代码 http://jomnius.blogspot。 com/2011/02/how-to-find-mfmailcomposeviewcontroller.html 现在将始终返回 nil。
There is no way to do this as of iOS 6 as mail composition is now done through an XPC service call to a remote process (MailCompositionService). There is a great explanation here: http://oleb.net/blog/2012/10/remote-view-controllers-in-ios-6/. The lowest level in the view hierarchy is now an _UIRemoteView which interfaces to the remote process. The code from the blog post at http://jomnius.blogspot.com/2011/02/how-to-find-mfmailcomposeviewcontroller.html will now alway return nil.