Loading annotations from url using background thread. Pins doesn't show before moving or scaling mapView

女生的网名这么多〃 提交于 2019-12-01 22:51:19

You are updating the UI from a non UI - Thread this will not work

You will have to call segments of code that update your ui inside the UIThread Block as following:

For example

[mapView removeAnnotations:annotationsOnMap];

must be called in UI-Thread

   dispatch_async(dispatch_get_main_queue(), ^{
        //Update UI if you have to
        [mapView removeAnnotations:annotationsOnMap];
    });

Please note that you have to call all your UI updates inside the main_queue thread

   dispatch_async(dispatch_get_main_queue(), ^{
        //All UI updating code must come here
    });
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!