• 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: Right place to unobserve notifications in a document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Right place to unobserve notifications in a document


  • Subject: Re: Right place to unobserve notifications in a document
  • From: "Joan Lluch (casa)" <email@hidden>
  • Date: Wed, 20 Aug 2008 15:37:59 +0200



Am Mo,18.08.2008 um 20:14 schrieb Andy Lee:


Since the observed object (maybe notification center) will still hold a reference to the observing object, there is a problem. The *observer* will not be freed, if the observed is still living. Obviously you have a problem using GC, for example if you have an observing window and an observed model instance. The model probably lives longer than the window. (Think of info windows …)


This seems to be the reason for the weak reference using GC.

I've been reading this thread and I don't understand it in the case of GC. Why don't you still have to remove the observer from the notification center when you are not longer using it. Even if it is held as a weak reference, it will still remain registered for receiving notifications, so what when the observer is eventually collected, won't the notification center continue sending messages to the observer as long as it remains registered to receive them?, Please clarify.


Joan Lluch


_______________________________________________

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: Right place to unobserve notifications in a document
      • From: "Michael Ash" <email@hidden>
    • Re: Right place to unobserve notifications in a document
      • From: Negm-Awad Amin <email@hidden>
References: 
 >Right place to unobserve notifications in a document (From: Negm-Awad Amin <email@hidden>)
 >Re: Right place to unobserve notifications in a document (From: "Michael Ash" <email@hidden>)
 >Re: Right place to unobserve notifications in a document (From: Negm-Awad Amin <email@hidden>)
 >Re: Right place to unobserve notifications in a document (From: Andy Lee <email@hidden>)
 >Re: Right place to unobserve notifications in a document (From: Negm-Awad Amin <email@hidden>)
 >Re: Right place to unobserve notifications in a document (From: Andy Lee <email@hidden>)
 >Re: Right place to unobserve notifications in a document (From: Negm-Awad Amin <email@hidden>)

  • Prev by Date: How do I register a cocoa bundle identifier?
  • Next by Date: Re: Best Way to Handle Properties?
  • Previous by thread: Re: Right place to unobserve notifications in a document
  • Next by thread: Re: Right place to unobserve notifications in a document
  • Index(es):
    • Date
    • Thread