• 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: Observing with GC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Observing with GC
      • From: Rob Keniger <email@hidden>
    • Re: Observing with GC
      • From: David Carlisle <email@hidden>
References: 
 >Observing with GC (From: Quincey Morris <email@hidden>)
 >Re: Observing with GC (From: Rob Keniger <email@hidden>)

  • Prev by Date: Re: ObjC 2.0 Class +encodeWithCoder:
  • Next by Date: Re: ObjC 2.0 Class +encodeWithCoder:
  • Previous by thread: Re: Observing with GC
  • Next by thread: Re: Observing with GC
  • Index(es):
    • Date
    • Thread