0

我加载一个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错误。我该如何解决?

4

1 回答 1

0
-(IBAction)donePressed:(id)sender
{
printf("Done\n");
printf("Removing View\n");
[moviePlayer_af.view removeFromSuperview];
}
于 2013-02-14T13:32:22.797 回答