¡@

Home 

2014/10/15 ¤U¤È 10:13:43

iphone Programming Glossary: selectedann

How to keep data associated with MKAnnotation from being lost after a callout pops up and user taps disclosure button?

http://stackoverflow.com/questions/9797047/how-to-keep-data-associated-with-mkannotation-from-being-lost-after-a-callout-po

improve this question In the showPinDetails method you can get the currently selected annotation from the map view's selectedAnnotations property. That property is an NSArray but since the map view only allows one annotation to be selected at a time.. be selected at a time you would just use the object at index 0. For example void showPinDetails id sender if mapView.selectedAnnotations.count 0 no annotation is currently selected return id MKAnnotation selectedAnn mapView.selectedAnnotations objectAtIndex.. id sender if mapView.selectedAnnotations.count 0 no annotation is currently selected return id MKAnnotation selectedAnn mapView.selectedAnnotations objectAtIndex 0 if selectedAnn isKindOfClass VoiceMemoryAnnotation class VoiceMemoryAnnotation..