Re: Observing with GC
Re: Observing with GC
- Subject: Re: Observing with GC
- From: glenn andreas <email@hidden>
- Date: Mon, 25 Feb 2008 09:02:26 -0600
On Feb 24, 2008, at 11:45 PM, Rob Keniger wrote:
On 25/02/2008, at 12:30 PM, Quincey Morris wrote:
Do we know if KVO observing keeps weak references to observed
objects (and observers too, for that matter, but I'm mostly
interested in observed objects atm) in a GC-only application?
No, you need to make sure you call -removeObserver:forKeyPath: at
some point. For custom views I usually do this in -
removeFromSuperView but if necessary you could put it in a -finalize
block.
Note that in the non-GC world, you can't do that in -dealloc (since
the KVO "warning" about deallocating something that is still be
observed happens before the call to dealloc), so it's unclear if there
isn't some similar helpful warning before -finalize is called...
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium | prime : build, mutate, evolve, animate : the next
generation of fractal art
_______________________________________________
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