为什么我的 UINavigationController 会向 Zombie 发送消息?

发布于 2024-09-30 14:50:10 字数 519 浏览 0 评论 0原文

我有一个奇怪的问题。

我有一个 UINavigationController ,里面有 UITableViewController 。

简而言之: UINavigationController + UITableViewController + 更改设备方向原因:

[CALayer release]: message sent to deallocated instance

问题:快速滚动表格并更改设备方向几次后,出现“[CALayer release]:消息发送到已释放实例”错误。

我通过“分配”对其进行调试,然后看到:

0 CALayer Malloc 1 UIKit [UIView _createLayerWithFrame:]
1 CALayer Zombie -1 QuartzCore CA::release_objects<X::List<void const*>*)

这是什么意思以及我应该做什么?

I have a weird problem.

I have a UINavigationController with UITableViewController inside.

In a nutshell: UINavigationController + UITableViewController + change device orientation causes:

[CALayer release]: message sent to deallocated instance

The problem: after fast scrolling table and changing device orientation a few times the "[CALayer release]: message sent to deallocated instance" error appears.

I debug it through "Allocations" and see:

0 CALayer Malloc 1 UIKit [UIView _createLayerWithFrame:]
1 CALayer Zombie -1 QuartzCore CA::release_objects<X::List<void const*>*)

What does it mean and what I supposed to do?

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

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

发布评论

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

评论(1

遗弃M 2024-10-07 14:50:11

您显然存在内存管理问题。

对您来说最好的选择是分析您的代码,您可以使用CMD+SHIFT+A来完成。它将对您的代码进行静态分析,并用漂亮的蓝色箭头标记 clang 分析器 报告可能的内存问题。

作为猜测,我敢打赌您在 viewDidAppear / viewDidDisappear 中遇到问题。

You clearly have a memory management issue.

The best bet for you would be to Analyze your code, which you can do with CMD+SHIFT+A. It will run a static analysis of your code and mark with nice blue arrows the places where the clang analyser reports possible memory issues.

As a guess, I'd wager that you have a problem in a viewDidAppear / viewDidDisappear.

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