Hello! I am trying to use MKMapView without any Apple code samples, although there are several other of them of varying clarity. (I know, βRead the friendly manual.β I did it, but it's not 100% clear, so please carry me on that.)
Here is the situation. I have an MKMapView object in which I added a set of ten MKPinAnnotation objects. So far, so good. Everything is highlighted / released safely, and there seem to be no complaints from the Tools.
On initial display, I configured an MKCoordinateRegion object with a center point at our first output location and a (arbitrary) range of 0.2 x 0.2. Then I call:
[mapView setRegion:region animated:YES]; [mapView regionThatFits:region];
Wow! It worked out well.
Meanwhile ... I also have a segmented control that allows me to move around each contact point. Thus, when I scroll through the list, the map enlivens each new location of contacts with a new pair of calls to setRegion: animated: and regionThatFits: ... or at least that's the idea.
While the map "moves" to the new location of contacts, the map itself is not updated from below. Instead, I see my pin against a gray / blank card ... until I pushed the card in any direction, but not much. Then the map shows! (If I only move a short distance from the previous pin arrangement, I usually see which part of the map is already loaded.)
I suspect I'm doing something dumb here, but I couldn't understand that, at least, not from MapKit docs. Maybe I'm using the wrong calls? (Well, I need to set the area at least once, right? Moving around doesn't help, though.) I also tried using setCenterCoordinate: animated: - same problem.
I do not accept anything at this moment (no pun intended). Just trying to find my way.
Keys are welcome / appreciated!
UPDATE: calling setRegion: animated: and regionThatFits: for the first time, and then setCenterCoordinate: animated: while going through the list. no effect. An interesting conclusion: if I changed the animated value of NO in both cases, the map will be updated !!! Only when it is set to YES. (What's going on ?! Animated: broken? It can't be ... ???)