ARC圆形保留检测 [英] ARC circular retain detection

查看:74
本文介绍了ARC圆形保留检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将一些旧代码移植到Objective-C ARC(自动引用计数),它看起来效果很好。除了一个相当大的高级对象在从我的导航堆栈中弹出时没有被释放,让我相信我在ARC隐藏的某个地方有一个保留周期(或者至少很难追踪)。什么是消除这种潜在保留周期的最佳方法和/或确定ARC下内存泄漏原因的好方法是什么?谢谢!

I ported some old code over to Objective-C ARC (Automatic Reference Counting) and it seems to work great. Except a rather large, high-level object is not being deallocated when it is popped off of my navigation stack, making me believe I have a retain cycle somewhere that ARC has hidden from me (or at least made difficult to track down). What is the best way to weed out this potential retain cycle and/or what is a good way to determine the cause of a memory leak under ARC? Thanks!

推荐答案

最好的方法通常是使用乐器应用程序中的Leaks乐器

The best way is usually to use the Leaks instrument in the Instruments app.

来自仪器新功能视频WWDC 2011 讨论使用Instruments在ARC下查找保留周期,开始时间约为38分钟。

The What's New In Instruments video from WWDC 2011 discusses using Instruments to find retain cycles under ARC, starting about 38 minutes in.

这篇关于ARC圆形保留检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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