加载MKMapView时崩溃 [英] Crash when loading MKMapView

查看:97
本文介绍了加载MKMapView时崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

加载 MKMapView 时,我遇到了一个特殊的崩溃。出现的模式是我在一个视图中打开ABPeoplePickerNavigationController,后者又触发 UINavigationController 委托方法

I am having a peculiar crash when loading MKMapView. The pattern of occurrence is when I open ABPeoplePickerNavigationController in one view, which in turn triggers the UINavigationController delegate method

和保存/不保存后我移动到另一个视图 - 它工作正常。下一个观点 - 它的工作正常。但是当我用 MKMapView 进入视图时,它会崩溃。

And after saving/without saving I move to another view--its working fine. Next view--its working fine. But when I enter the view with MKMapView, it crashes.

没有其他视图有任何问题。只有加载 MKMapView 的视图与以下日志崩溃

No other views are having any problem. Only the view which loads MKMapView crashes with the following log

*** -[UINavigationBar barStyle]: message sent to deallocated instance

我在代码中注释了部分加载mapview然后它工作正常。因此,当mapview加载时,我的导航栏似乎已在某处解除分配。但我无法理解的是,应用程序中没有其他视图有任何问题,只有mapview崩溃的那个。我尝试了不同的测试模式,并确保其他任何视图都没有任何问题。

I have commented the part in the code which loads the mapview and then it works fine. So it seems that my navigation bar is deallocated somewhere, when the mapview loads. But what I cant understand is that, no other view in the app has any problem, only the one with mapview crashes. I have tried different patterns of testing and made sure that none of the other views are having any problems.

应用程序在模拟器中不会崩溃。它只在设备上崩溃。为什么这个问题只出现在加载mapview的视图中,而不是其他视图中。

The app doesn't crash in simulator. It crashes only on device. Why is this issue only in the view which loads mapview and in no other views.

我试过分析来分析我的问题。这是我发现的,但它没什么帮助。

I tried profiling to analyze my problem. Here is what I found, but its not much helpful.

推荐答案

我遇到了同样的问题。

这是ABPeoplePickerNavigationController上的泄漏问题。你必须确保它不会被解除分配。

It's a leak issue on the ABPeoplePickerNavigationController. You have to ensure it won't be deallocated.

我宣称它是一个强大的财产,以确保它不会被解除分配并且工作正常:)

I'm declaring it as a strong property to ensure it won't be deallocated and it works fine :)

这篇关于加载MKMapView时崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆