我需要有关 MKMapView 崩溃的帮助
我的实时应用程序最常见的崩溃之一是 MKMapView 崩溃。它在内部方法 -[MKMapView mapTileViewDidFinishLoading:]
处崩溃。在我的测试过程中,我无法追溯崩溃,但在 iTunes Connect 的崩溃报告中非常频繁。有人对这次崩溃有经验吗?它只是一张非常简单的地图,仅显示一个注释。
这是这次崩溃的完整堆栈跟踪:
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000009
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x339737d8 objc_msgSend + 16
1 MapKit 0x345709ec -[MKMapView mapTileViewDidFinishLoading:]
2 CoreFoundation 0x344492e4 -[NSObject(NSObject) performSelector:withObject:]
3 Foundation 0x3326981e __NSThreadPerformPerform
4 CoreFoundation 0x34460f1e __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
5 CoreFoundation 0x34432ba0 __CFRunLoopDoSources0
6 CoreFoundation 0x34432444 __CFRunLoopRun
7 CoreFoundation 0x34432270 CFRunLoopRunSpecific
8 CoreFoundation 0x34432178 CFRunLoopRunInMode
9 GraphicsServices 0x3026b5ec GSEventRunModal
10 GraphicsServices 0x3026b698 GSEventRun
11 UIKit 0x31ad011c -[UIApplication _run]
12 UIKit 0x31ace128 UIApplicationMain
13 MYApp 0x00002e08 main + 36
14 MYApp 0x00002dd8 start + 32
One of the most frequent crashes of my live app is a crash at MKMapView. It crash at the internal method -[MKMapView mapTileViewDidFinishLoading:]
. During my test I could not retrace the crash but is very frequent in the crash reports on iTunes Connect. Has anyboday some experience with this crash? It is only a very simple map showing exactly one annotation.
Here is the complete stacktrace of this crash:
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000009
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x339737d8 objc_msgSend + 16
1 MapKit 0x345709ec -[MKMapView mapTileViewDidFinishLoading:]
2 CoreFoundation 0x344492e4 -[NSObject(NSObject) performSelector:withObject:]
3 Foundation 0x3326981e __NSThreadPerformPerform
4 CoreFoundation 0x34460f1e __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
5 CoreFoundation 0x34432ba0 __CFRunLoopDoSources0
6 CoreFoundation 0x34432444 __CFRunLoopRun
7 CoreFoundation 0x34432270 CFRunLoopRunSpecific
8 CoreFoundation 0x34432178 CFRunLoopRunInMode
9 GraphicsServices 0x3026b5ec GSEventRunModal
10 GraphicsServices 0x3026b698 GSEventRun
11 UIKit 0x31ad011c -[UIApplication _run]
12 UIKit 0x31ace128 UIApplicationMain
13 MYApp 0x00002e08 main + 36
14 MYApp 0x00002dd8 start + 32
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想我可能已经在我自己的应用程序中解决了这个问题。看来这个帖子有正确的解决方案和解释。
导致我的应用程序失败的消息是“mapViewDidFinishLoadingMap”,它是 MKMapViewDelegate 的消息。尝试在视图 dealloc 方法中将 mapView 委托设置为“nil”。
I think I may have fixed this issue in my own application. It appears that this post has the correct solution and explanation.
The message that was causing the failure in my application was 'mapViewDidFinishLoadingMap' which is a message of the MKMapViewDelegate. Try to set the mapView delegate to 'nil' before in your views dealloc method.
只要这样做就能100%解决问题
Just do this it will solve the problem 100%
我还必须在 viewDidDisappear 中将委托设置为 nil 才能解决该问题。
I also had to set the delegate to nil in viewDidDisappear to fix the issue.