地图视图上的 EXC_BAD_ACCESS
当我运行地图应用程序时,我收到此错误和 EXC_BAD_ACESS...任何想法
#0 0x3510741c in objc_msgSend ()
#1 0x30a69364 in -[CLLocationManager onClientEventLocation:] ()
#2 0x30a66960 in -[CLLocationManager onClientEvent:supportInfo:] ()
#3 0x30a66b28 in OnClientEvent ()
#4 0x30a5f860 in CLClientInvokeCallback ()
#5 0x30a633e4 in CLClientHandleDaemonData ()
#6 0x357a902c in __CFMessagePortPerform ()
#7 0x3577be46 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#8 0x3577be04 in __CFRunLoopDoSource1 ()
#9 0x3576e0a4 in __CFRunLoopRun ()
#10 0x3576dd7a in CFRunLoopRunSpecific ()
#11 0x3576dc88 in CFRunLoopRunInMode ()
#12 0x336ace8c in GSEventRunModal ()
#13 0x318f0f94 in -[UIApplication _run] ()
#14 0x318ee4d4 in UIApplicationMain ()
#15 0x0000281c in main (argc=1, argv=0x2ffff5e0) at /Users/abcd/Desktop/wataproject/main.m:14
i get this error and EXC_BAD_ACESS when i run my maps application... any idea
#0 0x3510741c in objc_msgSend ()
#1 0x30a69364 in -[CLLocationManager onClientEventLocation:] ()
#2 0x30a66960 in -[CLLocationManager onClientEvent:supportInfo:] ()
#3 0x30a66b28 in OnClientEvent ()
#4 0x30a5f860 in CLClientInvokeCallback ()
#5 0x30a633e4 in CLClientHandleDaemonData ()
#6 0x357a902c in __CFMessagePortPerform ()
#7 0x3577be46 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#8 0x3577be04 in __CFRunLoopDoSource1 ()
#9 0x3576e0a4 in __CFRunLoopRun ()
#10 0x3576dd7a in CFRunLoopRunSpecific ()
#11 0x3576dc88 in CFRunLoopRunInMode ()
#12 0x336ace8c in GSEventRunModal ()
#13 0x318f0f94 in -[UIApplication _run] ()
#14 0x318ee4d4 in UIApplicationMain ()
#15 0x0000281c in main (argc=1, argv=0x2ffff5e0) at /Users/abcd/Desktop/wataproject/main.m:14
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://brainwashinc.wordpress.com/2010/ 01/05/mapkit-crash-getting-user-location/
这帮助我解决了这个问题
http://brainwashinc.wordpress.com/2010/01/05/mapkit-crash-getting-user-location/
This helped me solve this issue
@vivianaranha 的方法可能会解决这个问题,但我相信(在我自己遇到这个问题之后)你正在做其他坏事。
具体来说,在我的例子中,我设置了
mapView.showsUserLocation = YES
,因此在幕后,mapView 将自身连接到 CLLocationManager。解决方案是确保我在 viewWillDisappear 中调用了mapView.showsUserLocation = NO
。我还发现,在调用
mapView.showsUserLocation = YES
之前,您必须将mapView.userTrackingMode
设置为您需要的内容。把它们放在一起,你最终会得到这样的结果:@vivianaranha's approach might solve the issue but I believe (after encountering this myself) that you are doing something else bad.
Specifically, in my case I had set
mapView.showsUserLocation = YES
so under the hood mapView was wiring itself up to the CLLocationManager. The solution was to ensure that I calledmapView.showsUserLocation = NO
in viewWillDisappear.Also I discovered that you must have
mapView.userTrackingMode
set to what you require before you make the call tomapView.showsUserLocation = YES
. Putting it all together you end up with something like this: