views:

199

answers:

3

Hi, I have several annotation pins (aprox 700) in a MapView. Is there any way I can select from an UITableView a row and change the color of a group of pins? Lets say each row representing a group of pins.. Thank you in advance!

A: 

You set your pin colours in the MKMapViewDelegate method mapView:viewForAnnotation:. If you use MKPinAnnotationView, you are limited to three colours (red, green purple), which is efficient if you have lots of pins.

If you want, you can return a custom view, possibly a UIImageView, which can be any colour you like.

Setting the values in a tableView: that's up to you. I'd probably pass it in my custom annotation object.

If you want to change an existing view, you could save the views in a NSSet or other collection class as you create them, or you could remove the annotation objects and re-add them to your map.

Paul Lynch
any ideas? im stuck here
I would suggest you save the views as they are created (in the above method), and change the colours that way.
Paul Lynch
A: 

Thanks Paul for your answer, the thing is... I am able to display de PIN in my map, however I don't know how to replace the existing ones with another color. Thanks again!

A: 

any ideas? im stuck here