[objective-c]UINavigationControllerをaddChild

UINavigationControllerをaddChildしたりremoveFromParentViewControllerしたり

UIViewController*cv=[[UIViewController alloc]init];
UINavigationController*nc=[[UINavigationController alloc]initWithRootViewController:cv];
[self addChildViewController:nc];
[containerView addSubview:nc.view];//containerViewはUIView
currentCV=cv;

[currentCV.navigationController removeFromParentViewController];
[currentCV removeFromParentViewController];
[currentCV.view removeFromSuperview];
currentCV=nil;