views:

195

answers:

2

I have been searching for this all night and I have just so frustrated. When a MKPinAnnotationView is clicked, the name and the subtitle comes up. I also want to center that point on the view. I figured there was some method I had to override because the information that pops up happened without me having to code it. Hopefully this was clear enough for you all.

And in the mean time, I feel like there is some hidden guide on this use of MKMaps and other classes. Either that or it is terribly documented because I am having a lot of trouble finding information. Thanks.

+2  A: 

Have you tried overriding setSelected:animated:? (defined in MKAnnotationView)

No because I was using the MKPinAnnotationView that was given, I didn't subclass it.
Jake Schwartz
And the MKAnnotationView doesn't know about my MKMapView because that is the class that calls it.
Jake Schwartz
I know this is messy, but I would subclass MKPinAnnotationView that does two things:1) Holds a reference to a MKMapView that you set when creating the annotation2) Overrides setSelected:animated: to center the map
Thanks, I am now headed in the right direction.
Jake Schwartz
A: 

and what means to "subclass MKPinAnnotationView" exactly ? can you bring some code here ?

izne
The green checkmark means that a correct answer has been selected, and that was months ago, so you really don't need to dig this up again.
Rob Lourens