2010-10-23 62 views
0

我甲肝導航欄上的按鈕用於打開郵件視圖控制器.. 我使用視圖基於應用呈現郵件撰寫視圖控制器,當我點擊按鈕的執行我寫,但不是IBAction爲呈現視圖....不能在視圖上

-(IBAction)mailid:(id)sender{ 

MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init]; 
controller.mailComposeDelegate = self; 

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
NSString *documentsDirectory = [paths objectAtIndex:0]; 
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"Report.html"]; 

NSData *myData = [NSData dataWithContentsOfFile:path]; 

[controller addAttachmentData:myData mimeType:@"html" fileName:@"Attachment-1"]; 
[self presentModalViewController:controller animated:YES]; 

[controller release]; 


} 

任何幫助....

回答

0

不知道averything別人是正確的,但MIME類型應該是@"txt/html",而不僅僅是@ 「HTML」

+0

我正在使用這個iPad應用程序 – 2010-10-23 15:27:39

+0

@Iak,嘗試修復MIME類型...你也應該檢查是否有可能使用發送郵件[MFMailComposeViewController canSendMail]客服 – Vladimir 2010-10-23 15:30:28

相關問題