Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to inspect an NSAutoreleasePool's objects?

Tags:

objective-c

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

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

like image 287
Jacob Relkin Avatar asked Jan 28 '11 08:01

Jacob Relkin


1 Answers

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.

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

like image 69
kennytm Avatar answered Nov 15 '22 06:11

kennytm