如何获取 UINavigationController 子视图
我在 splitView 中有一个详细视图控制器 - SearchDeatilViewController。但该视图控制器附加到导航控制器。 我怎样才能让那个子视图控制他?
我尝试像这样重新加载子视图 tableView:
SearchDetailViewController *detail1 = (SearchDetailViewController *)[self.viewControllers objectAtIndex:1];
[detail1.tableView reloadData];
但它给了我错误:
-[UINavigationController reloadTable]:无法识别的选择器发送到实例
似乎我在变量detail1中获得的对象是navigationController类型。显然我需要更深入一层。我怎样才能做到这一点?
谢谢
I have one detail view controller in splitView - SearchDeatilViewController. But that view controller is attached to navigation controller.
How can I get that subview to take controll of him?
I tried like this, to reload sub view tableView:
SearchDetailViewController *detail1 = (SearchDetailViewController *)[self.viewControllers objectAtIndex:1];
[detail1.tableView reloadData];
But it gives me error:
-[UINavigationController reloadTable]: unrecognized selector sent to instance
It seems that the object I get in variable detail1 is of type navigationController. Obviously I need to go one level deeper. How can I do that?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了解决方案。只需标记子视图,然后使用 [myView viewWithTag:X] 访问它们即可。
I found a solution. Just tagged subviews and than access them with [myView viewWithTag:X] and it works.