使用MFMailComposeViewController的问题 [英] Problems using MFMailComposeViewController
问题描述
我正在尝试设置它,以便人们可以从我的应用程序中发送电子邮件。我引用这个帖子来做这个,但是我在构建中收到这些警告:
I'm trying to set it up so people can email from within my application. I'm referencing this post to do this, but I'm getting these warnings on the build:
然后当我运行它,它的错误:
and then when I run it, it bugs:
我想知道如果我把代码放在错误的地方。只要你知道我已经把
I'm wondering if I've simply placed the code in the wrong area. Just so you know I have placed
#import <MessageUI/MessageUI.h>
在头文件中。
谢谢帮助!
编辑1
似乎问题在于如何设置ViewController。实际上,我的所有UI代码都在一个单独的对象中,如下所示。这使我很难理解哪个代码在哪里。任何建议?
It seems as if the problem lies within how my ViewController is setup. In fact all my UI code is in a separate object as shown below. This is making it difficult for me to understand which code goes where. Any advice?
推荐答案
看起来你的SpeakHereController不是一个UIViewController。
Well it looks like your SpeakHereController isn't a UIViewController.
因此,它找不到用于呈现和关闭modalViewController的方法。
您还需要实现 MFMailComposeViewControllerDelegate
,将其添加到您的viewcontroller。
Therefore it can't find the methods for presenting and dismissing the modalViewController.
Also you need to implement the MFMailComposeViewControllerDelegate
, add it to your viewcontroller.
这篇关于使用MFMailComposeViewController的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!