Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 09-13-2009, 01:18 PM   #8 (permalink)
shibq
Registered Member
 
Join Date: Aug 2008
Posts: 9
shibq is on a distinguished road
Default

Although [mapView selectAnnotation:currentAnnotation animated:FALSE] is the solution, but there is a catch to get it work consistently:

the code

for (id currentAnnotation in mapView.annotations) {
if ([currentAnnotation isEqual:annotationToSelect]) { [mapView selectAnnotation:currentAnnotation animated:FALSE]; } }

should be called from - (void)mapViewDidFinishLoadingMapMKMapView *)mapView, and nowhere else.

The underlying reason is a bit tricky:
The sequence in which the various methods like viewWillAppear, viewDidAppear of UIViewController and the - (void)mapViewDidFinishLoadingMapMKMapView *)mapView is called is different between the first time the map is loaded with one particular location and the subsequent times the map is displayed with the same location.
shibq is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,183
Threads: 93,922
Posts: 402,161
Top Poster: BrianSlick (7,968)
Welcome to our newest member, gab20
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:55 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.