2013-02-14 3 views
0

xib를로드 한 다음 버튼을 눌러 닫아야합니다. 나는 이것을 사용하고 있습니다 : IBAction은 EXC_BAD_ACCESS 오류를 발생시킵니다.

- (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 오류. 어떻게 해결할 수 있습니까?

+2

1. 'check_result'는 무엇을합니까? 2. [self.view removeFromSuperview]; - *** 오, 왜? *** –

+0

제대로 연결된 IBAction을 확인 하시겠습니까? 당신은 그보기 컨트롤러를 제시하고 있습니까 ?? –

+0

클릭시 즉시 충돌이 발생합니까 아니면 대상 메서드를 통과 한 후 충돌이 발생합니까? – AppleDelegate

답변

0
-(IBAction)donePressed:(id)sender 
{ 
printf("Done\n"); 
printf("Removing View\n"); 
[moviePlayer_af.view removeFromSuperview]; 
} 
관련 문제