• 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: Too many replies to Notifications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Too many replies to Notifications


  • Subject: Re: Too many replies to Notifications
  • From: Charles Srstka <email@hidden>
  • Date: Thu, 14 Aug 2003 04:42:47 -0500

You need to pass the NSTask that you want to be notified about for the object: parameter. Otherwise, you will be notified when *any* NSTask terminates. If you pass a specific NSTask there, you will only get notified when that one terminates.

Charles

On Thursday, August 14, 2003, at 02:18 AM, Chad Armstrong wrote:

I have two different classes in the same application, and each uses
NSNotificationCenter to determine when a new NSTask has been launched
and then completed. Each class uses a different selector when the task
has terminated.

Example code:

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(doSomething:)
name:NSTaskDidTerminateNotification
object:nil];

My problem is that when a new task is finished, BOTH of the selector
methods (i.e. doSomething: and doSomething2:) are both called. Why is
this happening, and now might I circumvent this problem? The prototype
to doSomething would look like this:

- (void) doSomething : (NSNotification *)aNotification;

Chad Armstrong
email@hidden
_______________________________________________
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: 
 >Too many replies to Notifications (From: Chad Armstrong <email@hidden>)

  • Prev by Date: Re: Getting the name of a class (solv0red)
  • Next by Date: Creating new instances of an IB object
  • Previous by thread: Too many replies to Notifications
  • Next by thread: Getting the name of a class
  • Index(es):
    • Date
    • Thread