0
我打开电子邮件表发送文件。除了我不能回到我的应用程序,它工作得很好。电子表格无法取消?
当我击取消按钮,就询问是否删除或保存草稿,并呆在那里。它不会回到应用程序页面。
代码:
//send email log-------------------------
NSLog(@"mail");
[[CCDirector sharedDirector] pause];
picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
//Fill in the email as you see fit
NSArray *toRecipients = [NSArray arrayWithObject:@"[email protected]"];
[picker setToRecipients:toRecipients];
NSArray *paths2 = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *dataPath = [[paths2 objectAtIndex:0] stringByAppendingPathComponent:@"Test.txt"];
NSData *data = [NSData dataWithContentsOfFile:dataPath];
[picker addAttachmentData:data mimeType:@"text/txt" fileName:@"Test.txt"];
NSString *emailBody = @"Test ";
[picker setMessageBody:emailBody isHTML:NO];
[picker setSubject:@"hardware test ## "];
//display the view
[[[CCDirector sharedDirector] openGLView] addSubview:picker.view];
[[CCDirector sharedDirector] stopAnimation];
编辑:
我加入的回答表明这里的功能,他叫我击球的时候取消该功能,但它停留在那个片。 我不得不说,我使用的是cclayer(cocos2d的),所以层与定义:
@interface HelloWorldLayer : CCLayer< MFMailComposeViewControllerDelegate>
任何其他建议?
非常感谢。
感谢,但他不接受 “resault”我错过了什么? – user1280535
确定我已经把它改为:(MFMailComposeViewController *)控制器didFinishWithResult:(MFMailComposeResult)的结果,但它仍然无法正常工作,我打取消,然后我不能再,但打它它留在这片。任何帮助? – user1280535
你是什么意思“他不接受结果”? – DrummerB