简体   繁体   中英

mapViewDidFinishLoadingMap: called too early

My problem is simple: I'm waiting to take a screenshot of an MKMapView, and I want to do it only once the map is loaded. Unfortunately, this delegate method is almost always called before the map is actually loaded. I just get a grid, or a few loaded tiles if I'm lucky. Is there a good way to do what I need to do? Or am I missing something in the MKMapViewDelegate protocol?

Thanks!

Perhaps you could try adding a timer and then take the screenshot in the completion block of the timer. Or perhaps, use the mapView:didUpdateUserLocation: delegate method as the callback for the screenshot instead of mapView:DidFinishLoadingMap:

这似乎是iOS 6中MapKit中的众多错误之一。希望它将通过iOS 7修复。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM