我需要有关 MKMapView 崩溃的帮助

发布于 2024-09-29 21:54:05 字数 1431 浏览 1 评论 0原文

我的实时应用程序最常见的崩溃之一是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

流年里的时光 2024-10-06 21:54:05

我想我可能已经在我自己的应用程序中解决了这个问题。看来这个帖子有正确的解决方案和解释。

导致我的应用程序失败的消息是“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.

再见回来 2024-10-06 21:54:05

只要这样做就能100%解决问题

-(void) viewWillDisappear:(BOOL)animated
{
    self.mapView.delegate = nil;
    mapView=Nil;
    NSLog(@"viewWillDisappear");

}

Just do this it will solve the problem 100%

-(void) viewWillDisappear:(BOOL)animated
{
    self.mapView.delegate = nil;
    mapView=Nil;
    NSLog(@"viewWillDisappear");

}
我还不会笑 2024-10-06 21:54:05

我还必须在 viewDidDisappear 中将委托设置为 nil 才能解决该问题。

I also had to set the delegate to nil in viewDidDisappear to fix the issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文