【发布时间】:2011-12-23 00:28:34
【问题描述】:
有问题,我想用 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];
}
我使用故事板来构建视图。这段代码在旧版本中运行良好。但我想尝试使用故事板。不幸的是,它不起作用。有人帮我吗?
【问题讨论】:
标签: iphone ios5 mapkit storyboard