mapViewDidFinishLoadingMap: called too early

偶尔善良 提交于 2019-12-22 05:21:59

问题


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!


回答1:


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:




回答2:


It seems this is one of the many bugs in MapKit in iOS 6. Hopefully it will be fixed with iOS 7.



来源:https://stackoverflow.com/questions/12700011/mapviewdidfinishloadingmap-called-too-early

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!