내 주요 UIViewController (PMGameViewController.h)는 내 응용 프로그램에서 호출하는 파일입니다.iPhone - Multiple UIViewControllers Release
메인 UIViewController (PMGameViewController.m)에는 여러 개의 버튼이 있습니다. 버튼을 누르면 insertSuvbiew를하고 위에 다른 UIViewController를 첨부합니다. 미니 게임이 끝나면 removeFromSubview 만 수행하면됩니다. 이것은 상단에 삽입 된 UIViewController를 제거하고 메인 메뉴를 보여줍니다. 내가 원하는 것은 완벽하지만 ...
removeFromSubview를 수행 한 후에 objectalloc이 삭제되지 않습니다. 해당 UIViewController 메모리를 어떻게 발표 할 수 있습니다. 나는 그것이 제거되었고 UIViewController 메모리를 해제한다는 것을 알기 위해 주 UIViewController (PMGameViewController.m)에 역 참조 할 수있는 방법을 모른다. 당신이 그것을 제거 후에는 전무로 뷰 컨트롤러를 설정할 수있는 하위 뷰를
//////////////////////////////////////
//Buttons are in PMGameViewController.m file
//////////////////////////////////////
if((UIButton *) sender == gameClassicBtn) {
//////////////////////////////////////
//This Inserts the GameClassic.h file
//////////////////////////////////////
GameClassic *gameClassicController = [[GameClassic alloc]
initWithNibName:@"GameClassic" bundle:nil];
self.gameClassic = gameClassicController;
[gameClassicController release];
[self.view insertSubview:gameClassicController.view atIndex:1];
}
if((UIButton *) sender == gameArcadeBtn) {
//////////////////////////////////////
//This Inserts the GameArcade.h file
//////////////////////////////////////
GameArcade *gameArcadeController = [[GameArcade alloc]
initWithNibName:@"GameArcade" bundle:nil];
self.gameArcade = gameArcadeController;
[gameArcadeController release];
[self.view insertSubview:gameArcadeController.view atIndex:1];
}
당신이 돈을 우리 대답이 싫어? 코멘트가 없습니까? – Julien