0
存在问题,我想使用alloutAccessoryControlTapped方法更改viewcontroller。但它不起作用。这里是我的代码:在故事板中更改视图控制器
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
NSLog(@"calloutAccessoryControlTapped");
Restaurant *location = [view annotation];
// RestaurantDetail *resdetail = [[RestaurantDetail alloc] init];
RestaurantDetail *resdetail = [self.storyboard instantiateViewControllerWithIdentifier:@"details"];
[resdetail setLocation:location];
[self.view addSubview:resdetail.view];
}
我用故事板来构建视图。这个代码在旧版vison中运行良好。但我想尝试使用故事板。不幸的是,它不起作用。任何人都帮助我?