Reputation: 1931
Could you please tell me, what are the changes have to be done to show annotation pin in iOS 6
. I have developed map based application in iOS 5
.It shows works well but after update in iOS 5
the map pins are not displaying in my application.How can i over come this in iOS 6?
Upvotes: 2
Views: 2492
Reputation: 330
I've had similar problems with my app. Under iOS 5, I was creating an MKMapView in viewDidLoad, but I was lazy about setting up the map view's delegate. Sometimes I added annotations to the map view BEFORE setting the map view's delegate. This all worked fine, PROVIDED that the delegate was set up inside viewWillAppear (or earlier).
With iOS 6, this no longer works. You must set up the delegate before adding annotations to the map view.
Hypothesis: In iOS 5.x, MapKit was caching annotations internally and passing these annotations to the map view after the delegate was established. In iOS 6, for whatever reason, this level of sophistication has been removed. Bummer… :-(
Hope this helps, Dave
Upvotes: 3