如何设置 [self varNavigationController] 在我的 ViewController 中不为空?
菜鸟写作,
我正在尝试使用导航控制器,但方法 PushViewController 不起作用,因为它是“null”。
同时,我在基于导航的应用程序模板中尝试了相同的代码,并且可以正常工作。
我的问题是,如何使 [self myVariableforNavigationController] 在我的 ViewBased 应用程序中不为空?我已经尝试了 AppDelegate 内的所有方法,但没有成功。
非常感谢!!!
noob writing,
I'm trying to use a Navigation Controller, but the method pushViewController doesn't work as it is 'null'.
At the same time I've tried the same code in a Navigation Based App Template, and I can do it work.
My question is, how can I make that [self myVariableforNavigationController] not to be null in my ViewBased App?? I've tried everything inside the AppDelegate but without success.
Thank you very much!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这里您可以添加自己的导航控制器。并将其与主控制器一起分配给根视图控制器。
现在,当您想要推送到另一个视图时,您可以轻松地做到这一点,因为基于视图的应用程序将导航控制器作为 rootViewCOntroller。因此,从现在开始,您不能将值设置为 null,并且可以轻松推送到第二个视图。
如果仍有疑问,请告诉我。
Here you can add your own navigation controller. And assign as it with the main controller to root viewcontroller.
Now when you want to push to another view you can easily do it as your view based application have the navigationcontroller as the rootViewCOntroller. So, you can't have the value to null from now onwards and you can push to second view easily.
Let me know if still having doubt.