移动地图后立即返回会导致 iPhone 中的应用程序崩溃

发布于 2024-12-14 08:58:14 字数 188 浏览 1 评论 0原文

我遇到过这样的情况:如果在地图尚未完全加载时点击后退图标,则立即移动地图 应用程序崩溃。

我能理解的是,由于加载仍在进行中,并且我点击回应用程序释放了控制器,但谷歌地图在 NSRUNloop 中异步加载(不确定)。所以这可能是不确定的问题。

那么有人知道可能是什么问题吗?有什么方法可以解决这个问题吗? 如果需要更多描述,请评论。

I came across the scenario where in if after moving the map immediately if I tap on back icon while the map has not fully loaded
The application crashes.

What I can understand is Since the loading is still in progress and I tap back the the application releases the controller but the google map loads asynchronously in NSRUNloop (not sure). So that might be the problem not sure though.

So does anybody know what can be the issue and is there any way to solve this issue?
Please comment if more description required.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

寂寞花火° 2024-12-21 08:58:14

听起来,当您关闭视图时,作为已完成地图加载的委托的对象已被释放,导致访问错误而崩溃。

找出这些类型崩溃的根源的一个好方法是使用 Instruments(Xcode 工具套件的一部分)并进行僵尸狩猎。

It sounds like that when you close the view, the object that is the delegate for the completed map load has been deallocated, causing the crash with a bad access.

A good way to get to the bottom of these types of crashes is to use Instruments (part of the Xcode suite to tools) and go zombie hunting.

幽蝶幻影 2024-12-21 08:58:14

对于仍在寻找答案的人来说,

到底发生了什么,即使控制器被释放导致应用程序崩溃,地图视图事件也会被触发。

因此,解决方案是objMKMapView 的值设置为nil之前,您需要将objMKMapView.delegate 的值设置为nil

For anyone who is still searching for the answer

What exactly happening was that map view events were getting fired even if the controller was released causing a crash in the app.

So the solution is Before setting the value of objMKMapView to nil you need to set value of objMKMapView.delegate to nil.

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