将视图推送到导航堆栈上
如果 ViewController 对象是在另一个类中创建的,而不是应该推送视图的类,那么该对象如何通过 navigationController 推送到视图中。
我遇到的问题是在我创建对象并设置其值的类中,我无法访问主导航控制器。当我调用 [self.NavigationController .... 它是未定义的。
如何访问该导航控制器?或者如何在一个类中创建 viewController 对象并通过另一个类设置值/将对象推送到视图中?
How is a ViewController object pushed into view via the navigationController if the object is created in another class than the one which should push the view.
The problem I had is in the class where I created the object and set its values, I had no access to the main navigationController. when I called [self.NavigationController .... It is undefined.
How is this navgation controller accessed? or how can I create a viewController object in one class and set values/push the object into view via another class?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设classA-mainViewController
classB- userDetailVC
在将对象压入堆栈之前将其传递给 classB
Suppose classA- mainViewController
and classB- userDetailVC
pass the Object to classB before its push on Stack