I have a mapview and i put an annotation which shows a custom title and subtitle pin. When the mapview starts the pin is visible but the title and subtitle are not. I have to press on the pin to show up the title and subtitle. Is it possible to show the title and subtitle without pressing the pin?
A:
this is just a suggestion but you can try
[myCustomAnnotationView becomeFirstResponder];
Morion
2009-12-17 20:05:23
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{ MKPinAnnotationView *newAnnotation = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"annotation1"]; newAnnotation.pinColor = MKPinAnnotationColorGreen; newAnnotation.animatesDrop=TRUE; newAnnotation.canShowCallout=YES; [newAnnotation becomeFirstResponder]; return newAnnotation;}I have put it here but its not working!
stefanosn
2009-12-17 20:17:32
A:
you could use
MKMapView *mapView;
id<MKAnnotation> myAnnotation;
// initialize mapView and myAnnotation...
[mapView selectAnnotation:myAnnotation animated:YES]
John Stallings
2009-12-17 20:32:22
yes, I have used this method in a number of applications, where are you calling this from?
John Stallings
2009-12-17 21:18:53
A:
anyway guys seems to be a problem at xcode specific version check the above link. this is working
stefanosn
2009-12-17 22:47:17