Re: Too many replies to Notifications
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.