こんにちは、フォーラムで検索しましたが、ヘルプが見つからなかったので、新しく投稿します。これがシナリオです。メインのルートビューコントローラーでmfmailcomposeviewcontrollerを作成しています。presentviewcontrollerを呼び出して表示していますが、閉じられると次のエラーが発生します。
error: address doesn't contain a section that points to a section in a object file
私が使用しているコードは以下のとおりです。
-(void) mailButtonTapped
{
if ([MFMailComposeViewController canSendMail]) {
mailViewController_ = [[MFMailComposeViewController alloc] init];
mailViewController_.mailComposeDelegate = self;
[mailViewController_ setSubject:@"Try ..."];
[mailViewController_ setMessageBody:@"Hey I just tried ..." isHTML:NO];
NSData *videoData = [NSData dataWithContentsOfURL:movieURL_];
[mailViewController_ addAttachmentData:videoData mimeType:@"video/quicktime" fileName:@"Video.mov"];
[self presentViewController:mailViewController_ animated:YES completion:nil];
}
else {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Sharing Not Possible" message:@"Configure your mail to send the mail" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alertView show];
[alertView release];
}
}
-(void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
NSString *title = @"Email";
NSString *msg = nil;
if (result == MFMailComposeResultFailed)
msg = @"Unable to send, check your email settings";
else if (result == MFMailComposeResultSent)
msg = @"Email Sent Successfully!";
else if (result == MFMailComposeResultCancelled || result == MFMailComposeResultSaved)
msg = @"Sending Cancelled";
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:title message:msg delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
[alertView release];
[self dismissViewControllerAnimated:YES completion:nil];
}
却下した後、エラーが表示されます:
error: address doesn't contain a section that points to a section in a object file
私を助けてください