error: address doesn't contain a section that points to a section in a object file

objective-c

Solution

I also had this error but with another scenario. I had a block property defined with @property (assign, nonatomic).

To fix this issue, I declared my block property with @property (copy, nonatomic).

Cheers

Problem

Hi i have searched here on the forum but no help found so i am posting it new. Here is the scenario, i am creating a mfmailcomposeviewcontroller in the main rootviewcontroller, i am displaying it by calling presentviewcontroller but when it is dismissed i get this error : ``` error: address doesn't contain a section that points to a section in a object file ``` The code i am using is given below: ``` -(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]; ``` } After dismissing i receive the error: ``` error: address doesn't contain a section that points to a section in a object file ``` Please help me

Original source