[英]method_exchangeImplementations causes an EXC_BAD_ACCESS error
[英]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];
这就是我的映射方式:
但是按下按钮后,我得到的只是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.