views:

418

answers:

3

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
- (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
A: 

you could use

  MKMapView *mapView;
  id<MKAnnotation> myAnnotation;
  // initialize mapView and myAnnotation...
  [mapView selectAnnotation:myAnnotation animated:YES]
John Stallings
i am trying it at the simulator is it supposed to work?
stefanosn
yes, I have used this method in a number of applications, where are you calling this from?
John Stallings
A: 

http://www.iphonedevsdk.com/forum/iphone-sdk-development/19740-trigger-mkannotationview-callout-bubble.html#post110447

anyway guys seems to be a problem at xcode specific version check the above link. this is working

stefanosn