Display selectedAnnotation info
Posted
by
elife_iPhone
on Stack Overflow
See other posts from Stack Overflow
or by elife_iPhone
Published on 2011-01-05T18:49:55Z
Indexed on
2011/01/05
18:53 UTC
Read the original article
Hit count: 171
When I use this: - (void)mapView:(MKMapView *)myMapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control {
NSLog(@"SelectedAnnotations is %@", myMapView.selectedAnnotations);
}
It Displays this in the log.
"<Annotation: 0x586cdb0>"
Now this is a weird question, but how do I get the info from this Annotation? I have lost my mind.
This is what is in the annotation.
myAnnotation = [[Annotation alloc] init]; myAnnotation.dealName=[NSString stringWithFormat:@"%@",[tempValue objectForKey:@"name"]]; myAnnotation.subName=[NSString stringWithFormat:@"Price: $%@",[tempValue objectForKey:@"price"]]; myAnnotation.latitude = [NSNumber numberWithDouble:[[tempValue objectForKey:@"dealLatitude"] doubleValue]]; myAnnotation.longitude = [NSNumber numberWithDouble:[[tempValue objectForKey:@"dealLongitude"] doubleValue]]; myAnnotation.dealId = [NSNumber numberWithInt:[ [tempValue objectForKey:@"dId"] intValue ]];
Thanks for your help.
© Stack Overflow or respective owner