1
showdetails를 보내는 주석을 찾는 방법은 무엇입니까?showdetails를 보내는 주석을 찾는 방법은 무엇입니까?
MKPinAnnotationView* customPinView = [[[MKPinAnnotationView alloc]
initWithAnnotation:annotation reuseIdentifier:BridgeAnnotationIdentifier] autorelease];
customPinView.pinColor = MKPinAnnotationColorPurple;
customPinView.animatesDrop = YES;
customPinView.canShowCallout = YES;
// add a detail disclosure button to the callout which will open a new view controller page
//
// note: you can assign a specific call out accessory view, or as MKMapViewDelegate you can implement:
// - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control;
//
UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[rightButton addTarget:self
action:@selector(showDetails:)
forControlEvents:UIControlEventTouchUpInside];
customPinView.rightCalloutAccessoryView = rightButton;
return customPinView;
- (void)showDetails:(id)sender
{
some code
}
을하지만 그는 하나를 클릭 한 많은 주석들 알고 싶어! – carbonr
@ carbonr,'view.annotation'은 클릭 한 것입니다. addTarget 대신 delegate 메서드를 사용하는 것이 좋습니다. – Anna
@ carbonr 위임자 대신 addTarget을 사용해야하거나 사용하려는 경우이 답변을 참조하십시오. http://stackoverflow.com/a/9876255/467105 – Anna