• 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: Does NSNotificationCenter have zeroing weak references to observers ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does NSNotificationCenter have zeroing weak references to observers ?


  • Subject: Re: Does NSNotificationCenter have zeroing weak references to observers ?
  • From: "Ken Ferry" <email@hidden>
  • Date: Wed, 13 Aug 2008 20:28:18 -0700

Yep, it's true.

http://developer.apple.com/documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcFinalize.html

"in a garbage collected environment, notification centers use zeroing
weak references"

Please be aware that this isn't (yet?) true for Key-Value Observing.

-Ken

On Wed, Aug 13, 2008 at 8:22 PM, Erik Buck <email@hidden> wrote:
> Does NSNotificationCenter use zeroing weak references to observers ?
>
> I want to say "When using Cocoa's automated memory garbage collection,
> NSNotificationCenter automatically un-registers observers that are no longer
> in use somewhere else in the application."  I'm just not sure it's true.
>  Can anyone save me the time of writing a test application?  In my test
> program, how can I tell the difference between an observer for which the
> NSNotificationCenter has a strong reference and an observer that is about to
> be finalized but hasn't been yet ?  Is this the classic "halting problem?"
>
> _______________________________________________
>
> 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
>
_______________________________________________

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: 
 >Does NSNotificationCenter have zeroing weak references to observers ? (From: Erik Buck <email@hidden>)

  • Prev by Date: Does NSNotificationCenter have zeroing weak references to observers ?
  • Next by Date: Re: @property and @synthesize not working
  • Previous by thread: Does NSNotificationCenter have zeroing weak references to observers ?
  • Next by thread: Re: Does NSNotificationCenter have zeroing weak references to observers ?
  • Index(es):
    • Date
    • Thread