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
2010-05-20 06:49:04
any ideas? im stuck here
2010-05-22 01:45:48
I would suggest you save the views as they are created (in the above method), and change the colours that way.
Paul Lynch
2010-05-22 08:13:53