0
我想簡單地設置一個detailViewController的標題爲引腳的標題,一旦出來的附件控件被調出。從calloutAccessoryControlTapped設置ViewController標題
這裏就是我設置MKAnnotation起來:
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id
<MKAnnotation>)annotation
{
MKAnnotationView *annotationView = [[MKPinAnnotationView alloc]
initWithAnnotation:annotation reuseIdentifier:@"loc"];
這裏就是我想要設置的細節視圖控制器到銷標題的標題:
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view
calloutAccessoryControlTapped:(UIControl *)control
{
DetailViewController *controller = [[DetailViewController alloc] initWithNibName:nil
bundle:nil];
[self.navigationController pushViewController:controller animated:YES]; // or use
presentViewController if you're using modals
controller.title = pin.annotationView.subtitle;
}
最後一行是搞砸了。有任何想法嗎?謝謝你們!!