I would like to add more locations 开发者_StackOverflow社区on MapView
something similar to this image. In this image there are only 2 pin points, but i need to have more than 10 locations to add in the map. Is this possible ? and is there any tutorial/sample code where i could start on this ?
You need to implement the annotation protocol, which simply requires you to include a couple of fields in an object so the map view knows what to annotate the 'pin' with.
You can then add multiple pins to the map view programatically.
I found this blog post useful when I was doing this.
http://mayurbirari.wordpress.com/2011/02/07/how-to-access-mkmapkit-in-iphone/
It's called MKPinAnnotationView and you can have as many as you want on map.
You need to implement protocol for it and it has pin as default image property.
精彩评论