来自不同视图控制器的 UINavigationController 中的 PushViewController
我的 iPhone 应用程序中有一个屏幕,我必须同时加载多种数据。为了简化我的代码,我创建了单独的视图并在其中加载了单独的视图控制器来处理每组数据。顶部的蓝色矩形有一个单独的 VC,下面的蓝色方块有另一个带有导航控制器的 VC。一切都很顺利,直到我突然需要在一个 VC 中将视图控制器推送到我的堆栈上(如果用户点击由不同 VC 处理的视图)。
I have a screen in my iPhone application where i have to load multiple kinds of data simultaneously. To simplify my code, I created separate view and loaded separate view controllers in them to handle each set of data. The blue rectangle on the top has a separate VC and the blue square(ish) below it has another VC that has a navigation controller. All is going well until I suddenly need to push a viewcontroller onto my stack in one VC if user taps on the view that is handled by a different VC.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以向每个“子”视图控制器添加一个属性,您可以在其中设置 UINavigationController。从“容器”视图中为每个“子”视图控制器设置 UINavigationController 并使用此导航控制器实例来推送其他视图控制器。
You could add a property to each "sub" view controller where you could set a UINavigationController. Set the UINavigationController from the "container" view for each "sub" view controller and use this navigation controller instance to push other view controllers.