내 iPhone 앱에서 ModalViewController를 표시하는 데 꽤 표준적인 레서피를 사용하고 있지만 레서피가 손상되어 혼동하는 상황에서 실행했습니다.ModalViewController를 닫을 때 EXEC_BAD_ACCESS
MatcherViewController *controller = [[MatcherViewController alloc] initWithNibName:@"MatcherView" bundle:nil];
[controller setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[controller setDelegate:self];
[self presentModalViewController:controller animated:YES];
[controller release];
이 항상 내가 믹스에 한 가지를 추가, 그리고 그것을 발표하기 전에 내가 좋아하는, 새로운 컨트롤러 객체에 메시지를 보낼 때까지 잘 작동합니다 : 이것은 (거의 항상) 나 프리젠 테이션을 설정하는 방법입니다 그래서 :
MatcherViewController *controller = [[MatcherViewController alloc] initWithNibName:@"MatcherView" bundle:nil];
[controller setPrimary:primaryIndex andSecondary:secondaryIndex];
[controller setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[controller setDelegate:self];
[self presentModalViewController:controller animated:YES];
[controller release];
이 메서드 호출을 추가하면 내가보기 컨트롤러 ... 어떤에서 EXEC_BAD_ACCESS 신호와 응용 프로그램의 충돌 지점을 기각 할 때까지 작동하는 것 같다. [controller release]
을 제거하면 여분의 선을 사용할 수 있지만 그 다음엔 누수가 발생할 수 있습니다. 프레젠테이션을하기 전에 개체에 메시지를 보내는 이유는 무엇입니까? 간단한 매개 변수를 ModalViewController에 전달하는 더 좋은 방법이 있습니까? 초보자를 교정에 시간
감사합니다; P 당신의 컨트롤러의 dealloc 방법에
-setPrimary : andSecondary :에서 무엇을하고 있습니까? –
매개 변수 (NSInteger)를 멤버 변수에 전달. – Devunwired