我有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