我正在使用 this绘制路线的源代码在线时崩溃,
polyline = [GMSPolyline polylineWithPath:path];
Terminating app due to uncaught exception 'GMSThreadException', reason: 'All calls to the Google Maps SDK for iOS must be made from the UI thread'
即使我走了through但对我不起作用。
最佳答案
在闭包中执行UI 更新时,请记住获取主线程并仅在主线程上执行 UI 操作
。
我的错误是,我试图在 Web 服务完成 block 中绘制标记。
dispatch_async(dispatch_get_main_queue(),
{
//Your code...
})
关于ios - polylineWithPath :path GMSThreadException 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43515305/