Re: Observing with GC
Re: Observing with GC
- Subject: Re: Observing with GC
- From: Chris Suter <email@hidden>
- Date: Wed, 27 Feb 2008 18:08:28 +1100
On 27/02/2008, at 5:59 PM, Antonio Nunes wrote:
On Feb 26, 2008, at 11:42 AM, Chris Suter wrote:
On a side note, it doesn't look like you have to call
removeObserver: for notifications registered with
NSNotificationCenter.
The garbage collection docs state:
"For example, a notification center should not form strong
relationships to registered observers, otherwise it artificially
prolongs the lifetime of those objects indefinitely."
I guess that corroborates it, but would anyone care to confirm
Chris's assertion with some authority?
I put a break point on CXXNotificationUnregister (which is what
removeObserver: ultimately calls) and you find that it gets called
when a weak reference is zeroed.
- Chris
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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