• 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: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )


  • Subject: Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )
  • From: Andy Lee <email@hidden>
  • Date: Thu, 20 Jan 2011 22:20:06 -0500

On Jan 20, 2011, at 9:39 PM, Corbin Dunn wrote:
> Now for something like a button, it obviously won't run into this type of latent drawing issue, since they don't message the delegate every time they draw. However, if you temporarily allocated an object and set it as the target/action of a button, and then free that object while the button is still visible, then yes, that's a case where you want to reset it to nil.

I don't know why I had it in my mind that targets are retained.  If they were, they'd run into the same retain cycles as delegates would if *they* were retained.

I think it would be going to extremes to nil out button targets in dealloc.  I think a common-sense approach is best after all, and I retracted the bug I mentioned earlier because checking delegates for == self should be up to the discretion of the programmer.  Can't hurt to do it, but it almost certainly won't matter.

--Andy

_______________________________________________

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

References: 
 >Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually ) (From: Abdul Sowayan <email@hidden>)
 >Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually ) (From: Corbin Dunn <email@hidden>)

  • Prev by Date: Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )
  • Next by Date: Re: Help on Cocoa Class references
  • Previous by thread: Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )
  • Next by thread: Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )
  • Index(es):
    • Date
    • Thread