views:

109

answers:

1

Using a MKMapView I have a pile of annoatations loaded onto it and I want to be able to filter the annotations displayed with a segmented control.

I'm using custom annotations with a type variable so I can tell them apart from one another but I haven't been able to find a way to hide and display a subset of annotation views at will.

+2  A: 

sure... try this:

[[yourMapView viewForAnnotation:yourAnnotation] setHidden:YES]

This will return you the view associated with the specified annotation object, then you can set the view to hidden. Here is the documentation.

Ryan Ferretti
Thanks for that, worked a treat. Sorry for not getting back to this sooner.
Affian
np... Glad to help!
Ryan Ferretti