저는 SourceListViewController라는 사용자 정의 viewController가 있는데,이 뷰를 UINavigationController에 추가합니다.이 뷰는 아이폰 앱의 창에 추가됩니다. SourceListViewController를 UINavigationController에 전달한 후 sourceListViewController를 릴리스합니다.initWithRootViewController가 전달되는 viewController 클래스를 유지하지 않는 이유는 무엇입니까?
SourceListViewController *sourceListVC = [[SourceListViewController alloc] initWithNibName:@"SourceListViewController" bundle:nil];
UINavigationController *navigationController = [[[UINavigationController alloc] initWithRootViewController:sourceListVC] autorelease];
[sourceListVC release];
이렇게하면보기가 휴대 전화에로드 된 후 응용 프로그램이 중단됩니다. 마지막 줄을 주석 처리하면 응용 프로그램이 올바르게 작동합니다. initWithRootViewController가 sourceListVC의 복사본을 유지하기로되어 있지 않습니까?
이는 sourceListVC가 유지된다는 것을 의미하지 않습니다. NavigationController를 해제하면 모든 ViewController도 해제되고 NVC는 루트보기 컨트롤러를 유지하지 않습니다. – karim