繁体   English   中英

IBAction导致EXC_BAD_ACCESS错误

[英]IBAction causes EXC_BAD_ACCESS error

我加载了xib,然后需要用一个按钮将其关闭。 我正在使用这个:

- (IBAction)donePressed:(id)sender {
    printf("Done\n");
    [self check_result];
    printf("Removing View\n");
   [self.view removeFromSuperview];
}

我像这样加载XIB:

AFUserFeedbackController *moviePlayer_af = [[AFUserFeedbackController alloc] initWithNibName:@"UserFeedback" bundle:nil];
UIWindow *backgroundWindow = [[UIApplication sharedApplication] keyWindow];
moviePlayer_af.view.frame = backgroundWindow.frame;
[backgroundWindow addSubview:moviePlayer_af.view];

这就是我的映射方式:

http://i.picresize.com/images/2013/02/13/T2AHc.png

但是按下按钮后,我得到的只是EXC_BAD_ACCESS错误,我得到以下输出:

(lldb)

EXC_BAD_ACCESS错误。 我该如何解决?

-(IBAction)donePressed:(id)sender
{
printf("Done\n");
printf("Removing View\n");
[moviePlayer_af.view removeFromSuperview];
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM