Objective-C retain counts in dealloc

Posted by Michael Waterfall on Stack Overflow See other posts from Stack Overflow or by Michael Waterfall
Published on 2010-05-30T15:52:58Z Indexed on 2010/05/30 16:02 UTC
Read the original article Hit count: 233

Filed under:
|

I'm seeing something fairly strange here, I've got breakpoints set in various dealloc methods in my app, and on inspection, the retain counts of the object self varies from 1 to 0. When dealloc is called, will the retain count of the object be set to 0 already?

I'm using print (int) [self retainCount] in the console to test this.

The 0's seem to only appear in the dealloc of my NSOperation's that are being run in an NSOperationQueue.

Any idea why this is?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa