2010-03-25 31 views
0

在我的应用程序中,用户可以使用相机拍摄照片,或者从图书馆中选择一张作为附件发送。我使用MFMailComposeViewController提供无缝电子邮件。在我的iPhone 3GS上,电子邮件视图与附件一起显示需要大约5-7秒的时间。MFMailComposeViewController:如何在视图出现时得到通知?

现在我想在用户按下“发送”按钮并在电子邮件视图出现时隐藏该视图时显示进度指示器视图。问题是MFMailComposeViewController代表only calls when the email sending is done

当电子邮件窗口出现在屏幕上时,我能以某种方式得到通知吗?

回答

0

编辑:我只是想过......你不能只在你的视图中添加进度指示器,而作曲者视图将会在它之上?这样,当MFMailComposerViewController委托人调用其方法时,您可以轻松地删除该指标。

我没有看到任何简单的方法来获得通知。为此编写一个类别呢?

@interface MFMailComposeViewController (MyAddition) 

@end 


@implementation MFMailComposeViewController (MyAddition) 

- (void)viewDidAppear:(BOOL)animated { 
    [self.mailComposeDelegate mailComposerDidAppear]; 
    [super viewDidAppear:animated]; 
} 

@end 
+0

我正在使用一个显示在电子邮件视图顶部的模式警报框。 – 2010-03-25 14:47:28

+0

好的,然后尝试使用该类别。确保执行'-mailComposerDidAppear'。 (如果你想摆脱编译器的警告,那么再创建一个'MFMailComposeViewControllerDelegate'类别。 – bddckr 2010-03-25 14:50:13

+0

通过类别添加通知是解决方案。 – 2010-03-28 17:34:52

相关问题