NSNotificationCenter and a modal window - a problem
NSNotificationCenter and a modal window - a problem
- Subject: NSNotificationCenter and a modal window - a problem
- From: Alexander Bokovikov <email@hidden>
- Date: Wed, 24 Mar 2010 12:11:50 +0500
Hi, All,
I have a project where a progress of NSTask is indicated through this
code:
if ([self popup] != nil)
anObj = [self popup];
else
anObj = self;
[[NSNotificationCenter defaultCenter] addObserver:anObj
selector:@selector(getData:)
name:NSFileHandleReadCompletionNotification
object:[[mytask standardError] fileHandleForReading]];
[[NSNotificationCenter defaultCenter] addObserver:anObj
selector:@selector(taskTerminated:)
name:NSTaskDidTerminateNotification
object:mytask];
[[[mytask standardError] fileHandleForReading]
readInBackgroundAndNotify];
All is going OK when I have a progress bar in the main window, so
anObj = self. But I'd like to use just the same code to show a
progress of the same NSTask by a NSProgressIndicator, placed in a
modal NSPanel, opened through [NSApp runModalForWindow:]. In this case
NSTask is launched and is executed OK, And it does what it should. But
none of notifications are going to my popup modal window.At least
getData method is never called, as debugger shows it.
self is AppController, popup is a subclass of NSWindowController.
What is the problem reason? Is it possible to receive notifications in
a modal window?
Thanks.
_______________________________________________
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