• 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
NSNotificationCenter and a modal window - a problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSNotificationCenter and a modal window - a problem
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Trouble forking my project
  • Next by Date: Re: NSNotificationCenter and a modal window - a problem
  • Previous by thread: Re: Automating Photoshop CS4?
  • Next by thread: Re: NSNotificationCenter and a modal window - a problem
  • Index(es):
    • Date
    • Thread