how to use addChildViewController in subview
I want to use addChildViewController in View (one view fro subviews array) but I don't know about that. this is my code : for (UIView *subview in self.view.subviews) { if (subview.tag == 1) { CartView *cart = [[CartView alloc]init]; [cart willMoveToParentViewController:????];/* (UIViewController*) from subview*/ [cart.view setFrame:CGRectMake(0.0f,CGRectGetHeight(self.view.frame),CGRectGetWidth(self.view.frame),CGRectGetHeight(self.view.frame))]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.3]; [cart.view setFrame:CGRectMake(0.0f,0,CGRectGetWidth(self.view.frame)