我加载一个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_BAD_ACCESS
错误,我得到了这个输出:
(lldb)
和EXC_BAD_ACCESS
错误。我该如何解决?