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中運行良好。但我想嘗試使用故事板。不幸的是,它不起作用。任何人都幫助我?