gpt4 book ai didi

swift - 在分配仍然有效的情况下重置区域分配器

转载 作者:搜寻专家 更新时间:2023-10-31 22:53:11 25 4
gpt4 key购买 nike

在我的带有 MKMapView 的 ViewController 取消初始化后,我在 XCode 10.2.1 中收到以下消息。

[Memory] Resetting zone allocator with 24 allocations still alive

我在 ViewController 中使用以下代码来清理 MKMapView。执行此操作或删除 ViewDidDisappear 事件中的委托(delegate)似乎并不重要。

deinit {
self.mapView.delegate = nil
}

这是否表明实际存在内存泄漏或我需要修复的其他问题?在多次打开/关闭 ViewController 后,它似乎没有泄漏内存。

最佳答案

在 deinit 中调用 mapView.removeAnnotations(mapView.annotations) 为我修复了它。仅当存在集群注释并且 map 在解除分配之前正在缩放或平移时才会发生。

关于swift - 在分配仍然有效的情况下重置区域分配器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56061758/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com