Ios iAction导致EXC\u错误\u访问错误

Ios iAction导致EXC\u错误\u访问错误,ios,objective-c,button,exc-bad-access,ibaction,Ios,Objective C,Button,Exc Bad Access,Ibaction,我加载一个xib,然后我需要用一个按钮关闭它。我用的是: - (IBAction)donePressed:(id)sender { printf("Done\n"); [self check_result]; printf("Removing View\n"); [self.view removeFromSuperview]; } 我这样加载XIB: AFUserFeedbackController *moviePlayer_af = [[AFUserFeedba

我加载一个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];
这就是我映射它的方式:

但按下按钮后,我得到的是
EXC\u BAD\u ACCESS
error,我得到以下输出:

(lldb)

EXC\u坏访问
错误。我怎样才能解决这个问题?

1。
检查结果的作用是什么?2. <代码>[self.view removeFromSuperview]-哦,为什么?检查iAction是否连接正确?您正在演示视图控制器吗?崩溃是在单击时立即发生还是在使用目标方法之后发生?问题是,它甚至没有达到该点。如果它会在任何事情之前打印
完成
。@AppleDelegate,当我点击按钮时立即出现。
-(IBAction)donePressed:(id)sender
{
printf("Done\n");
printf("Removing View\n");
[moviePlayer_af.view removeFromSuperview];
}