[iPhone] iterate through all the MKPolygons on my map view
[iPhone] iterate through all the MKPolygons on my map view
- Subject: [iPhone] iterate through all the MKPolygons on my map view
- From: Philip Vallone <email@hidden>
- Date: Sat, 13 Nov 2010 08:51:47 -0500
Hi,
I have added some MKPolygons to my map view. I want to loop through all my polygons and delete the one that has a certain title. My question is; how do I access the properties of the mkpolygon after the overlays have been added to the map view.
This is how I am creating the MKPolygon
MKPolygon* poly = [MKPolygon polygonWithCoordinates:points count:[myPoints count]];
poly.title = @"someName";
self.strokeColor = [[UIColor redColor] colorWithAlphaComponent:0.5];
[mapView addOverlay:poly];
In this loop, I am trying to access all the overlays, But I don't know how to access the MKPolygon. How do I iterate through all the MKPolygons on my map view?
for (id <MKOverlay> overlay in mapView.overlays) {
//todo access polygons title property
}
Thanks
Phil
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden