我有一个MapViewController,封装是Segue公司到一个UIViewController都放在一个故事板一个UITableViewController一个UINavigatioController一个UINavigationController。在地图上点击它时有一个按钮我希望调用UITableViewController并能够打开UIViewController。呼叫从一个MapViewController
如果我叫
[self presentViewController:self.tableViewController animated:NO completion:nil];
的TableViewController显示,但在披露指标点击抛出异常时:
“找不到赛格瑞‘showApartmentDetails’导航控制器。只有当源控制器由UINavigationController实例管理时,才能使用推塞网。“
创建类型的UINavigationController的属性和使用
self.navigationController = (UINavigationController*)[self.storyboard instantiateViewControllerWithIdentifier:@"myNavigationController"];
[self.navigationController pushViewController:self.tableViewController animated:NO];
什么都不做初始化它!
请告知我该如何调用导航器?
你是什么意思tableViewNavigationController是什么类型的属性呢? self是mapviewcontroller它没有presentViewController接口'没有可见的@interface'MapViewController'声明选择器'pushViewController:animated:' –
@liva我编辑了我的解决方案。这个属性应该是包含'tableViewController'的'UINavigationController'。 –
创建一个插座,我需要创建我自己的类,从UINavigationController派生的,什么也不做,而是我用这个'self.navigationController =(UINavigationController *)[self.storyboard instantiateViewControllerWithIdentifier:@“myNavigationController”];' –