Hi tôi đã tìm kiếm ở đây trên diễn đàn nhưng không có sự giúp đỡ tìm thấy vì vậy tôi đang gửi nó mới. Đây là kịch bản, tôi đang tạo ra một mfmailcomposeviewcontroller trong rootviewcontroller chính, tôi đang hiển thị nó bằng cách gọi presentviewcontroller nhưng khi nó được sa thải tôi nhận được lỗi này:lỗi: địa chỉ không chứa một phần trỏ đến một phần trong một tập tin đối tượng
error: address doesn't contain a section that points to a section in a object file
Mã tôi đang sử dụng được đưa ra dưới đây:
-(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];
}
Sau khi sa thải tôi nhận được lỗi:
error: address doesn't contain a section that points to a section in a object file
Hãy giúp tôi
Bạn đang sử dụng ARC? – Max
không, tôi không sử dụng – kashif789us
tôi đã cố gắng phát hành mailViewController sau khi bỏ quaviewviewcontroller nhưng không may mắn – kashif789us