我想使用 Storyboard 在我的弹出窗口中添加一个导航栏。
当我尝试通过引用 Storyboard中弹出的导航 Controller (指我的弹出屏幕)的按钮来完成它时:
然后,我尝试将委托(delegate)分配给我的弹出 Controller :
CheckBoxListingViewController *rdvc = [segue destinationViewController];
rdvc.delegate = self;
但是当我尝试 NSLog 时,它总是在弹出 Controller 中返回 null。
我认为原因是因为我引用导航 Controller 而不是直接引用弹出 Controller ,因为当我直接引用它时,委托(delegate)不再为空。
我可以做什么来完成这些屏幕?有什么建议吗?非常感谢!
最佳答案
destinationController
指的是您的 UINavigationController
试试这个:
CheckBoxListingViewController *foo = (CheckBoxListingViewController *)((UINavigationController *)segue.destinationViewController).topViewController;
关于ios - 如何使用 Storyboard 在 UIPopover 中设置导航栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13347060/