将 Popover 视图连接到 iPad 的详细信息视图
我有 UISplitViewController,我想从位于 UIPopoverController 中的 UIViewController 进行更新。
当我选择主 VC 中与详细 VC 连接的单元格(拆分视图中的左表)时,我使用以下命令:
DetailViewControlleriPad *dvc = [[self.splitViewController viewControllers] objectAtIndex:1];
dvc.detailItem = object;
但是,我尝试在弹出窗口中执行此操作,但它不会更新详细信息视图。有没有办法做到这一点,或者我只能从主视图更新详细视图?
I have UISplitViewController that I want to be updated from a UIViewController that is housed in a UIPopoverController.
When I select a cell in the master VC (the left table in a split view) connected with the detail VC, I use this:
DetailViewControlleriPad *dvc = [[self.splitViewController viewControllers] objectAtIndex:1];
dvc.detailItem = object;
However, I tried doing this in the popover, but it doesn't update the detail view. Is there a way to make this work, or can I only update the detail view from the master view?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试拨打:
You could try to call:
您应该实现 UISplitViewControllerDelegate 并使用其方法获取对根视图控制器和详细视图控制器的引用。
另一种方法是始终在根视图控制器中引用详细视图控制器(从 IB 的开头或通过代码),而不是尝试在 splitviewcontroller 的视图层次结构中找到它。
You should implement UISplitViewControllerDelegate and use its methods to get a reference to the root view controller and detail view controller.
Another method would be to always have a reference to your detailviewcontroller in the root view controller (from the beginning in IB or through code) instead of trying to find it in the splitviewcontroller's view hierarchy.