5
내 응용 프로그램에서이 예제를 사용했다
,calloutAccessoryControlTapped은/
http://spitzkoff.com/craig/?p=81
하지만 내가 accessorycontrol를 탭으로 calloutAccessoryControlTapped을 트리거/호출되지 트리거.
여기 내 코드입니다. 나는 잠시 동안이 문제로 어려움을 겪고있다
- (void)viewDidLoad {
MapAnnotation *annotation = nil;
annotation = [[MapAnnotation alloc] initWithCoordinate:[[trackPointsArray objectAtIndex:trackPointsArray.count - 2] coordinate]];
[mapView addAnnotation:annotation];
[super viewDidLoad];
}
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
MKAnnotationView *annotationView = nil;
// start pin
static NSString *StartPinIdentifier = @"StartPinIdentifier";
MKPinAnnotationView *startPin = [annotationView dequeueReusableCellWithIdentifier:StartPinIdentifier];
if (startPin == nil) {
startPin = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:StartPinIdentifier] autorelease];
startPin.animatesDrop = YES;
startPin.pinColor = MKPinAnnotationColorGreen;
startPin.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
startPin.canShowCallout = YES;
startPin.enabled = YES;
UIImage *image = [UIImage imageNamed:@"location.png"];
UIImageView *imgView = [[UIImageView alloc] initWithImage:image];
startPin.leftCalloutAccessoryView = imgView;
}
annotationView = startPin;
return annotationView;
}
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
NSLog(@"calloutAccessoryControlTapped");
}
, 많은 사람들이뿐만 아니라 같은 문제가있는 것 같다. 도움이 될 것입니다. 감사합니다