Skip navigation.
 
mlRe: Intercepting retain/release of object
FROM : Stuart Malin
DATE : Wed Mar 19 19:41:30 2008

Thanks all!


On Mar 19, 2008, at 8:04 AM, Jonathan del Strother wrote:
> -(id)retain needs to return itself, not void.



On Mar 19, 2008, at 8:09 AM, Pierre Molinaro wrote:
> The retain method should return self object :


So it should. Changing that fixed the problem.
Hmmm... the compiler never warned me that I had a mismatched return 
type (isn't return type a part of a method's signature?).

I know the release could have freed the object, and so my call to 
retainCount could gen an exception... tolerable in my context of 
debugging.


On Mar 19, 2008, at 8:12 AM, Rob Napier wrote:
> When you say "really odd behavior" can you confirm that you mean
> "actually different from normal behavior" versus "not the behavior
> your were expecting?"


The behavior was different than normal -- my code made the retain 
count value wrong. It is now correct.

>  It does not surprise me that there may be a
> retain involved during the removal of an object from an array. I would
> expect it in order to manage KVO notifications which may fire after
> the object is removed but before it is deallocated.


Yes - that is what I was seeing: a retain upon removing -- which 
confused me.

Related mailsAuthorDate
mlIntercepting retain/release of object Stuart Malin Mar 19, 18:54
mlRe: Intercepting retain/release of object Jonathan del Strot… Mar 19, 19:04
mlRe: Intercepting retain/release of object Nick Zitzmann Mar 19, 19:04
mlRe: Intercepting retain/release of object Pierre Molinaro Mar 19, 19:09
mlRe: Intercepting retain/release of object Rob Napier Mar 19, 19:12
mlRe: Intercepting retain/release of object Stuart Malin Mar 19, 19:41
mlRe: Intercepting retain/release of object Scott Ribe Mar 21, 19:13
mlRe: Intercepting retain/release of object j o a r Mar 21, 20:38
mlRe: Intercepting retain/release of object Sherm Pendley Mar 21, 21:16
mlRe: Intercepting retain/release of object Stuart Malin Mar 21, 21:32
mlRe: Intercepting retain/release of object Sherm Pendley Mar 21, 22:36
mlRe: Intercepting retain/release of object Erik Buck Mar 21, 23:38
mlRe: Intercepting retain/release of object Jack Repenning Mar 24, 05:31
mlRe: Intercepting retain/release of object Stuart Malin Mar 24, 05:50
mlRe: Intercepting retain/release of object Jack Repenning Mar 24, 17:12