iPhone:20分钟后在MapView中出现应用程序崩溃

问题描述:

我正在研究跟踪用户位置的应用程序。大约20分钟后,似乎应用程序总是崩溃,我不知道为什么。设备日志显示:iPhone:20分钟后在MapView中出现应用程序崩溃

Exception Type: EXC_BAD_ACCESS (SIGSEGV) 
Exception Codes: KERN_INVALID_ADDRESS at 0x069f6000 
Crashed Thread: 0 

Thread 0 Crashed: 
0 Ride       0x00012e00 -[Route addCoordinate:] (Route.m:92) 
1 Ride       0x0000877a -[MyRidesMapViewController locationManager:didUpdateToLocation:fromLocation:] (MyRidesMapViewController.m:528) 
2 CoreLocation     0x0000931c -[CLLocationManager onClientEventLocation:] + 584 
3 CoreLocation     0x00007552 -[CLLocationManager onClientEvent:supportInfo:] + 98 
4 CoreLocation     0x000076a0 OnClientEvent + 16 
5 CoreLocation     0x00002ade CLClientInvokeCallback(__CLClient*, CLClientEvent, __CFDictionary const*) + 42 
6 CoreLocation     0x0000512c CLClientHandleDaemonDataLocation(__CLClient*, CLClientLocation const*, __CFDictionary const*) + 204 
7 CoreLocation     0x0000528a CLClientHandleDaemonData(__CFMessagePort*, long, __CFData const*, void*) + 298 
8 CoreFoundation     0x0006936a __CFMessagePortPerform + 242 
9 CoreFoundation     0x00071aa4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20 
10 CoreFoundation     0x00073848 __CFRunLoopDoSource1 + 160 
11 CoreFoundation     0x00074626 __CFRunLoopRun + 514 
12 CoreFoundation     0x0001d8e4 CFRunLoopRunSpecific + 224 
13 CoreFoundation     0x0001d7ec CFRunLoopRunInMode + 52 
14 GraphicsServices    0x000036e8 GSEventRunModal + 108 
15 GraphicsServices    0x00003794 GSEventRun + 56 
16 UIKit       0x000062a0 -[UIApplication _run] + 396 
17 UIKit       0x00004e10 UIApplicationMain + 664 
18 Ride       0x00002a20 main (main.m:14) 
19 Ride       0x000029d4 start + 32 

看起来我想释放一些已经发布的东西,但是什么?!我启用了NSZombie,它似乎没有帮助。

它曾经工作,我最近更新我的课堂使用自我。对于我综合的任何东西,这可能是问题吗?

编辑:我更新了错误。它似乎列出了每一行的行号,但他们似乎没有帮助找到问题。

您是否在设备上运行时启用了NSZombie?如果这样的机会你没有用完了。如你所知,NSZombie不断释放对象,以便你可以检测到双重释放。

虽然你有一些内存问题。静态分析仪会告诉你什么? (换档命令-A)。

+0

你知道我在做什么!废话,让我把它关掉,看看我的问题消失。 是的,使用静态分析器确实会显示一些我将要处理的问题... – 2010-08-03 02:08:49

+0

好的...如果解决方案不明显,则发布分析仪正在抱怨的代码示例。 – 2010-08-03 03:12:38

+0

好的,删除NSZombie没有帮助。我用更新后的错误更新了上面的帖子。看起来好像与地点有关,也可能在地图上绘制我的路线。 – 2010-08-03 17:19:41

将位置管理器委托设置为零然后释放它为我修复了崩溃。