有没有办法检查 NSAutoreleasePool 的对象? [英] Is there a way to inspect an NSAutoreleasePool's objects?

查看:73
本文介绍了有没有办法检查 NSAutoreleasePool 的对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想知道这是否可能,也许我可以检索当前存储在给定 NSAutoreleasePool 实例中的对象的 NSSet?

Just wondering if this is even possible, maybe I could retrieve an NSSet of objects that are currently stored in a given NSAutoreleasePool instance?

我浏览了 Apple 的 NSAutoreleasePool 参考并没有找到与此问题相关的太多内容.

I have looked through Apple's NSAutoreleasePool reference and have not found much pertaining to this question.

推荐答案

如果只是为了调试,可以使用函数 _CFAutoreleasePoolPrintPools() 打印池的内容,如文档所示在 TN2124 中.它从 Mac OS X 10.6 和 iOS 可能从 3.x 开始可用.

If the purpose is just for debugging, you could use the function _CFAutoreleasePoolPrintPools() to print the content of the pool, as documented in TN2124. It is available since Mac OS X 10.6 and iOS maybe since 3.x.

或者,类方法 [NSAutoreleasePool showPools] 执行相同的操作.

Alternatively, the class method [NSAutoreleasePool showPools] performs the same action.

这篇关于有没有办法检查 NSAutoreleasePool 的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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