Re: Intercepting retain/release of object
Re: Intercepting retain/release of object
- Subject: Re: Intercepting retain/release of object
- From: Stuart Malin <email@hidden>
- Date: Wed, 19 Mar 2008 08:41:30 -1000
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.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden