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 PROTECTED]
 <http://www.gandreas.com/> wicked fun!
quadrium | prime : build, mutate, evolve, animate : the next generation of fractal art



_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to