您好我在這裏搜索了論壇,但沒有找到幫助,所以我發佈它新。下面是這種情況,我創建主RootViewController的一個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];
}
駁回i之後收到錯誤:
error: address doesn't contain a section that points to a section in a object file
請幫我
您使用ARC嗎? – Max
不,我沒有使用 – kashif789us
我試圖釋放mailViewController後dismissingviewcontroller,但沒有運氣 – kashif789us