MKReverseGeocoder导致EXC_BAD_ACCESS?

时间:2010-09-20 19:56:28

标签: iphone ios4 exc-bad-access mkreversegeocoder

我的应用程序出现间歇性崩溃。崩溃日志显示的堆栈跟踪对我来说很难破译,因此希望其他人看到这一点并指出我正确的方向。

基本上,应用程序在启动时会执行反向地理编码请求,以显示用户在标签中的位置。此外,我还针对特定的API调用执行了另一个反向地理编码请求。

正在发生的事情是,有时这个MKReverseGeocoder需要很长时间才能回来。最终我假设我会收到一个失败的回调,有时我会这样做,但在此之前它可能是分钟

由于API调用也发出了另一个MKReverseGeocoder请求,我想也许多个并发调用存在问题?

这是我的stacktrace:

Program received signal:  “EXC_BAD_ACCESS”.
(gdb) backtrace
#0  0x30c237a0 in -[MKPlacemark _mapkit_cache_heapTime] ()
#1  0x30bffe60 in compareTimes ()
#2  0x32403b24 in CFBinaryHeapAddValue ()
#3  0x30c0030c in -[MKCache setObject:forKey:] ()
#4  0x30c2aa48 in -[MKReverseGeocodeCache addPlacemark:forCoordinate:] ()
#5  0x30c2251c in -[MKReverseGeocoder requester:didReceiveResponse:forRequest:] ()
#6  0x3388cc1c in -[PBRequester _tryParseData] ()
#7  0x3388b288 in -[PBRequester connection:didReceiveData:] ()
#8  0x337490ce in -[NSURLConnection(NSURLConnectionReallyInternal) sendDidReceiveData:originalLength:] ()
#9  0x33748ff0 in _NSURLConnectionDidReceiveData ()
#10 0x30899ff8 in URLConnectionClient::_clientDidReceiveData ()
#11 0x3088ca3e in URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload ()
#12 0x3088cb40 in URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload ()
#13 0x3088cb40 in URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload ()
#14 0x3088c8ce in URLConnectionClient::processEvents ()
#15 0x3088c878 in URLConnection::multiplexerClientPerform ()
#16 0x3088c7f8 in MultiplexerSource::perform ()
#17 0x3088c798 in MultiplexerSource::_perform ()
#18 0x323f4f48 in CFRunLoopRunSpecific ()
#19 0x323f4c1e in CFRunLoopRunInMode ()
#20 0x335051c8 in GSEventRunModal ()
#21 0x324a6c30 in -[UIApplication _run] ()
#22 0x324a5230 in UIApplicationMain ()
#23 0x000024f8 in main (argc=1, argv=0x2ffff504) at /Users/ben/projects/ABC/iphone/ABC/main.m:14

因为看起来它甚至不调用我的回调方法,所以我不知道在哪里寻找这个EXC_BAD_ACCESS问题。我的代表当然仍然活跃(我正盯着发起请求的View Controller)。

1最后一点:它只出现在iOS 3.1.3上。我还没有看到它发生在iOS 4.0 yet.u

2 个答案:

答案 0 :(得分:0)

以下是反向地理编码的Google API文档,该文档返回JSON以及XML输出,并且它是可靠且稳定的API。

http://code.google.com/apis/maps/documentation/geocoding/

例如这个url提供了JSON输出,所以使用它可以解决你的问题。让我知道它对你有用吗?

http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true_or_false

答案 1 :(得分:0)

尝试使用xcode配置文件中的Zombies乐器。这将帮助您找到导致EXC_BAD_ACCESS的对象内存。