i hav a button on navigation bar for opening the mail view controller .. i am using view based app and when i tap the button its executes the ibaction i wrote but not presenting the view ....
-(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开发者_如何学Python"];
NSData *myData = [NSData dataWithContentsOfFile:path];
[controller addAttachmentData:myData mimeType:@"html" fileName:@"Attachment-1"];
[self presentModalViewController:controller animated:YES];
[controller release];
}
any help ....
Not sure if averything else is correct, but mime type should be @"txt/html"
, not just @"html"
精彩评论