簡體   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