在我的故事板中(如上图所示),我有一个包含MKMapView和注释的ViewController。这些注释包含了一个“揭示图标”,当被点击时,应该将用户导航到另一个ViewController。为此,我已经在视图控制器之间创建了一个推送Segue。然后,我给它命名为“showDetail”,并实现了以下代码。
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
[self performSegueWithIdentifier:@"showDetail" sender:self];
}
然而,我遇到了以下错误。
Could not find a navigation controller for segue 'showDetail'. Push segues can only be used when the source controller is managed by an instance of UINavigationController.'
我做错了什么?我试着把我的源UIViewController更改为UINavigationController,但视图就只显示成黑屏。