I want to use addChildViewController
in View
(one view fro subviews array) but I don\'t know about that. this is my code :
for (UIV
From Apple's Documentation :
(Here content is considered as child controller)
Adding another view controller’s view to the container’s view hierarchy
- (void) displayContentController: (UIViewController*) content;
{
[self addChildViewController:content]; // 1
content.view.frame = [self frameForContentController]; // 2
[self.view addSubview:self.currentClientView];
[content didMoveToParentViewController:self]; // 3
}
Here’s what the code does:
So ,in your case you are trying to add ViewController to your view which doesn't work. The CartView
should be a UIViewController
not UIView