• 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: Notification Issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Notification Issue


  • Subject: Re: Notification Issue
  • From: Jerry Seeger <email@hidden>
  • Date: Thu, 11 Sep 2003 11:45:17 -0700

Unless you are using anObject to filter the notification, you can set it to nil rather than to self.

Jerry

On Thursday, September 11, 2003, at 11:23 AM, John Nairn wrote:

My application has two types of documents and one type needs to know if
the other one has just closed. I implemented the process by posting a
notification in the dealloc method of the second document type with
object self.

But then I noticed in Apple documentation on posting notification that:

notificationWithName:object:

+ (id) notificationWithName: (NSString *) aName object: (id) anObject
Returns a notification object that associates the name aName with the
object anObject .aName may not be nil .

This method copies aName and retains anObject .

My concern is that self (passed as anObject) will be retained while
being deallocated. It seems to work fine, but is such a notification
posting in delloc method forbidden?

------------
John Nairn (1-801-581-3413, FAX: 1-801-581-4816)
Web page: http://www.eng.utah.edu/~nairn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Notification Issue (From: John Nairn <email@hidden>)

  • Prev by Date: Notification Issue
  • Next by Date: Re: Notification Issue
  • Previous by thread: Notification Issue
  • Next by thread: Re: Notification Issue
  • Index(es):
    • Date
    • Thread