루트 viewcontroller가 다중 viewcontroller를 호출하는 프로젝트가 있습니다. 하위 뷰 컨트롤러의 뷰에 버튼이 있습니다. 버튼을 누르면 루트 뷰 컨트롤러에 다른 하위 뷰 컨트롤러를로드하도록 알려주기를 바랍니다.하위 뷰 컨트롤러가 루트 뷰 컨트롤러에 다른 하위 뷰 컨트롤러를로드하도록 알립니다.
//the function in this viewcontroller
-(IBAction)submitButtonPressed:(id)sender;
{
[self.parentViewController notifyLoadAnotherViewContrller ] ;
}
//the function in root viewcontroller
-(void) notifyLoadAnotherViewContrller
{
Submit *tController = [[AnotherViewController alloc] initWithNibName: @"AnotherViewController" bundle:nil];
self.vanotherViewController = tController;
[tController release];
[self.view insertSubview:tController.view atIndex:10];
}
하지만이하지 않는 내가 함수에서 브레이크 포인트 설정 작동 - (무효) 그것이 내가 함수 이름, 아무 문제를 확인 작동하지 않습니다
notifyLoadAnotherViewContrller합니다.
내가 잘못하고있는 이유는 무엇입니까? 당신의 IBAction를가 제대로 연결되어 있는지 확인 :
는 의견을안부
InterDev에서
[tController release]를 사용할 수 있습니다. ~ [tController autorelease]; 무슨 일이 일어나는지 보아라. –