• 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: KVO and object release timing (for a NSCollectionView)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KVO and object release timing (for a NSCollectionView)


  • Subject: Re: KVO and object release timing (for a NSCollectionView)
  • From: Kyle Sluder <email@hidden>
  • Date: Sat, 23 Jan 2010 12:16:12 -0800

On Sat, Jan 23, 2010 at 1:48 AM, vincent habchi <email@hidden> wrote:
> The problem is that when the represented object is removed from the array controller, the corresponding NSView is not immediately released. Instead, there is an implied CAAnimation (or something similar) that makes the NSView slowly fade away. Net result is that the NSView survives some tenths of a second after the represented object is released, and the KVO unregistering crashes.

Hooray for retain cycles; if you avoid them you get overrelease bugs!
(I can't wait for garbage collection.)

This happens a lot in any non-trivial context. You might want to have
some sort of notification or delegate method that keeps your object
alive long enough. Putting code after calling [super dealloc] is
usually a bad idea, because self will be a garbage pointer, and how
many of us are so careful about pointer lifetimes that we're immune to
writing use-after-free bugs, especially when we return to the code six
months later?

--Kyle Sluder
_______________________________________________

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: 
 >KVO and object release timing (for a NSCollectionView) (From: vincent habchi <email@hidden>)
 >Re: KVO and object release timing (for a NSCollectionView) (From: Corbin Dunn <email@hidden>)
 >Re: KVO and object release timing (for a NSCollectionView) (From: vincent habchi <email@hidden>)

  • Prev by Date: Re: Weird exception
  • Next by Date: Better Way to Add an Entity to an ArrayController
  • Previous by thread: Re: KVO and object release timing (for a NSCollectionView)
  • Next by thread: patching the responder chain: puzzled by the docs
  • Index(es):
    • Date
    • Thread