Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 从另一个情节提要加载uiviewcontroller容器_Objective C_Ipad_Uiviewcontroller_Containers - Fatal编程技术网

Objective c 从另一个情节提要加载uiviewcontroller容器

Objective c 从另一个情节提要加载uiviewcontroller容器,objective-c,ipad,uiviewcontroller,containers,Objective C,Ipad,Uiviewcontroller,Containers,当我将容器拖动到uivewcontroller中时,会得到一个红色的新uiviewcontroller。 我这里的问题是如何从另一个情节提要加载此新的视图控制器。您可以使用: UISoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle:nil]; UIViewController *viewController = [storyboard instantiateViewControllerWi

当我将容器拖动到uivewcontroller中时,会得到一个红色的新uiviewcontroller。

我这里的问题是如何从另一个情节提要加载此新的视图控制器。

您可以使用:

UISoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle:nil];
UIViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:identifierOfSearchedViewController];

如果我真的理解

您希望在ContainerView中添加另一个UIViewController,因此您可以使用segue(即嵌入属性)在故事板中创建它


如果你想这样做,不要使用不同的故事板。1故事板许多控制器只是像我上面所说的那样连接它。

是的,我可以用红色uiviewcontroller中的那个按钮来连接,我尝试了一下,但是我想不使用这个按钮来加载它。有什么方法可以这样做吗?你能解释更多吗?好的,您不想使用按钮,那么其他选项是什么?你到底想把它装在哪个地方?您可以在任何地方使用此方法,但您需要使用类似触发器(操作)的按钮或类似按钮。@user1645638您可以在代码中的任何位置调用它,指定更多问题它是一个包含不同模块的仪表板,每个容器包含模块的uiviewcontroller,在我的例子中,每个模块都有一个单独的情节提要,因此我希望在主情节提要的容器中显示这些情节提要(模块的)的根视图。在viewDidLoad of dashBoard中,情节提要加载所有其他UiviewController情节提要dashbord包含许多模块,如果我理解你的话,在同一个故事板上收集它们是非常困难的。