我有以下代码,当调用动作表上的按钮时被调用。但是当我按取消,然后删除草稿,它只是收费,并没有解雇。我在我的应用程序中的其他地方使用相同的代码,并从选择的tableview单元中调用它,并且它在那里找到。任何想法,为什么它不在这里工作?MFMailComposeViewController不从视图中消失
Ther在控制台冻结时也没有错误信息。
if([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"Dr. Chrono Support"];
NSDictionary* infoDict = [[NSBundle mainBundle] infoDictionary];
NSString* versionNum = [infoDict objectForKey:@"CFBundleVersion"];
NSString *appName = [infoDict objectForKey:@"CFBundleDisplayName"];
NSString *text = [NSString stringWithFormat:@"%@ %@",appName,versionNum];
// Set up recipients
NSArray *toRecipients = [NSArray arrayWithObject:@"[email protected]"];
//NSArray *ccRecipients = [NSArray arrayWithObjects:@"[email protected]", @"[email protected]", nil];
//NSArray *bccRecipients = [NSArray arrayWithObject:@"[email protected]"];
[picker setToRecipients:toRecipients];
//[picker setCcRecipients:ccRecipients];
//[picker setBccRecipients:bccRecipients];
// Attach an image to the email
//NSString *path = [[NSBundle mainBundle] pathForResource:@"rainy" ofType:@"png"];
//NSData *myData = [NSData dataWithContentsOfFile:path];
//[picker addAttachmentData:myData mimeType:@"image/png" fileName:@"rainy"];
// Fill out the email body text
NSString *emailBody = text;
[picker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:picker animated:YES];
[picker release];
}
谢谢,我完全忘了补充一点,谢谢! – Jon