![](/img/trans.png)
[英]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.