• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Intercepting retain/release of object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Intercepting retain/release of object
      • From: Scott Ribe <email@hidden>
References: 
 >Intercepting retain/release of object (From: Stuart Malin <email@hidden>)
 >Re: Intercepting retain/release of object (From: "Rob Napier" <email@hidden>)

  • Prev by Date: [SOLVED] - Re: NSString may not respond.... -and What is this invisible character?
  • Next by Date: Re: [SOLVED] - Re: NSString may not respond.... -and What is this invisible character?
  • Previous by thread: Re: Intercepting retain/release of object
  • Next by thread: Re: Intercepting retain/release of object
  • Index(es):
    • Date
    • Thread