MFMailComposeViewController 加载空白屏幕
我正在运行 OS 3.1.3 的 iPod Touch 上进行测试,
试图允许用户从应用程序内发送电子邮件 - 但当执行以下代码时,整个屏幕会完全变成空白/白色。
关于为什么会发生这种情况有什么想法吗? 我的项目中有MessageUI框架。 我在头文件中导入和委托:
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>
<MFMailComposeViewControllerDelegate>
这是代码,非常标准:
if ([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"App Feedback"];
[picker setToRecipients:[NSArray arrayWithObject:@"[email protected]"]];
[self presentModalViewController:picker animated:YES];
[picker release];
}
然后我有 didFinishWithResult 函数,该函数会在发送电子邮件时关闭 ModalViewController。
但同样,我在 iPod Touch 上看到的只是空白的白屏。 =/
谢谢!
I'm testing on an iPod Touch running OS 3.1.3
Trying to allow users to send an email from within the app - but when the following code is executed, the entire screen just turns completely blank / white.
Any ideas on why this is happening?
I've got the MessageUI framework in the project.
I'm importing and delegating in the header file:
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>
<MFMailComposeViewControllerDelegate>
And here's the code, pretty standard:
if ([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"App Feedback"];
[picker setToRecipients:[NSArray arrayWithObject:@"[email protected]"]];
[self presentModalViewController:picker animated:YES];
[picker release];
}
And then I have the didFinishWithResult function that would dismiss the ModalViewController when the email has been sent.
But again, all I get is a blank white screen on my iPod Touch. =/
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你可以看一下苹果的示例代码:
http://developer.apple.com/library/ios/ #samplecode/MessageComposer/Listings/Classes_MessageComposerViewController_m.html
-(IBAction)showMailPicker:(id)sender {
}
-(void)displayMailComposerSheet
{
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = 自我;
}
- (void)mailComposeController:(MFMailComposeViewController*)控制器
didFinishWithResult:(MFMailComposeResult)结果错误:(NSError*)错误 {
}
You can take look at sample code from apple:
http://developer.apple.com/library/ios/#samplecode/MessageComposer/Listings/Classes_MessageComposerViewController_m.html
-(IBAction)showMailPicker:(id)sender {
}
-(void)displayMailComposerSheet
{
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
}
- (void)mailComposeController:(MFMailComposeViewController*)controller
didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
}