我有ViewcontrollerA
,这是在storyboard
制成的图。 在此视图中,我有在storyboard
已经添加和创建的出口到它称为containerView
一个UIView
。添加一个UIViewController到一个UIView
我想添加一些其他的viewControllerB
(在storyboard
也制造)的容器。
试过:
//add to container a new view from storyboard,with id called serviceView
UIViewController *sv = [self.storyboard instantiateViewControllerWithIdentifier:@"ServiceView"];
[self.containerView addSubview:sv.view];
,并得到了崩溃。
我该怎么做?
谢谢。
这可能帮助? http://stackoverflow.com/questions/1486832/how-to-add-an-uiviewcontrollers-view-as-subview – Flexicoder