【发布时间】:2011-11-14 11:54:15
【问题描述】:
有人知道在调试模式下如何检查对象的保留计数吗?我试图添加一个表达式[objInstance retainCount],但它不起作用。我也在控制台中尝试了 print object PO [objInstance retainCount],但它再次不起作用。
【问题讨论】:
-
检查this descriptive post out 这个答案是今年年初提供的,但是有详细说明为什么不使用retain count
-
永远不要使用
retainCount!如果您想检查内存泄漏,请改用 xcode 内存泄漏工具 -
这里的“没用”是什么意思?
-
“不起作用”是指表达式没有给我保留计数。它显示
[objInstance retainCount] = (<unknown type>) <unknown type> -
感谢詹姆斯韦伯斯特的参考
标签: iphone objective-c ios debugging retaincount