2009-10-19 71 views

回答

0

我不知道它是什麼你錯過了,但在這裏,你有什麼可以幫助你:

- 確保你正在實現MFMailComposeViewControllerDelegate委託協議。

,尤其是圓形你的代碼片段,對我的作品:

MFMailComposeViewController * mc = [[MFMailComposeViewController alloc] initWithNibName:nil bundle:nil]; 
mc.mailComposeDelegate = self; 
[mc setToRecipients:[NSArray arrayWithObject:self.selectedRecipientEmail]]; 
NSString * subject = [NSString stringWithFormat:NSLocalizedString(@"Mail subject", nil)];  
[mc setSubject: subject]; 
[mc setMessageBody: [self composeMessageBodyAsHTML] isHTML:YES]; 
[self presentModalViewController:mc animated:YES]; 
[mc release]; 

在這裏你有委託方法

#pragma mark MFMailComposeViewControllerDelegate 

- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error { 

switch (result) 
{ 
    case MFMailComposeResultCancelled: 
     // Do something 
     break; 
    case MFMailComposeResultSaved: 
     message = NSLocalizedString(@"Saved! The email was successfully saved", @"Email saved message"); 
     // Do something 
     break; 
    case MFMailComposeResultSent: 
     // Do something 
     break; 
    case MFMailComposeResultFailed: 
     // Do something 
     break; 
    default: 
     // Do something 
     break; 
} 
} 

我希望這可以幫助,祝你好運!

相關問題