无法在iOS中获取位置(GEOErrorDomain代码= -204) [英] Can't get Location in iOS (GEOErrorDomain Code=-204)

查看:161
本文介绍了无法在iOS中获取位置(GEOErrorDomain代码= -204)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 MKMapView 显示地图并放置图钉。这是我的代码

I am trying to display a map and drop a pin using MKMapView. This is my code

MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } }; 
region.center.latitude = 37.47 ;
region.center.longitude = 122.26;
region.span.longitudeDelta = 0.01f;
region.span.latitudeDelta = 0.01f;
[mapView setRegion:region animated:YES];

但我收到以下错误

<GEOTileSource: 0x8e4c160>: Error downloading tiles Server Error: Error Domain=GEOErrorDomain Code=-204 "The operation couldn’t be completed. (GEOErrorDomain error -204.)" UserInfo=0x88990f0 
{UnderlyingErrors=(
"Error Domain=GEOErrorDomain Code=-204 \"The operation couldn\U2019t be completed. (GEOErrorDomain error -204.)\" UserInfo=0x885b570 {IncompleteResponse=Asked for 2 tiles but only got 0 back}",
"Error Domain=GEOErrorDomain Code=-204 \"The operation couldn\U2019t be completed. (GEOErrorDomain error -204.)\" UserInfo=0x8890a50 {IncompleteResponse=Asked for 6 tiles but only got 0 back}"
)}

我是没有找到任何对 GEOErrorDomain Code = -204 的引用。请帮帮我。

I am not finding any reference to what GEOErrorDomain Code=-204 is. Please help me out.

推荐答案

我有同样的问题,在我的情况下,只有在地图完成之前关闭UIViewController时才会发生加载所有瓷砖。
修复是在关闭视图控制器时将mapView(MKMapView)委托设置为nil。

I had the same issue, in my case it only happen when closing the UIViewController before the map completed loading all tiles. The fix was to set the mapView (MKMapView) delegate to nil when closing the view controller.

mapView.delegate = nil;

这篇关于无法在iOS中获取位置(GEOErrorDomain代码= -204)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆