• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[iPhone] iterate through all the MKPolygons on my map view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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

  • Follow-Ups:
    • Re: [iPhone] iterate through all the MKPolygons on my map view
      • From: Philip Vallone <email@hidden>
  • Prev by Date: Re: Default keyword selector type
  • Next by Date: Re: Default keyword selector type
  • Previous by thread: Re: Default keyword selector type
  • Next by thread: Re: [iPhone] iterate through all the MKPolygons on my map view
  • Index(es):
    • Date
    • Thread