objective-c – 错误:地址不包含指向目标文件中某个部分的部分

前端之家收集整理的这篇文章主要介绍了objective-c – 错误:地址不包含指向目标文件中某个部分的部分前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
嗨,我在这里搜索了论坛,但没有找到帮助,所以我发布新的.这是场景,我在主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];

}

解雇后我收到错误

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

请帮我

解决方法

我也有这个错误,但有另一种情况.我有一个用@property定义的块属性(assign,nonatomic).

为了解决这个问题,我用@property声明了我的块属性(copy,nonatomic).

干杯

猜你在找的C&C++相关文章