• 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: NSDistributedNotification in a Foundation tool
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDistributedNotification in a Foundation tool


  • Subject: Re: NSDistributedNotification in a Foundation tool
  • From: Alex Rice <email@hidden>
  • Date: Sun, 12 Jan 2003 14:42:10 -0700

On Sunday, January 12, 2003, at 03:31 AM, Finlay Dobbie wrote:


On Sunday, January 12, 2003, at 08:42 am, Alex Rice wrote:

I am trying to receive a NSDistributedNotification in a Foundation tool. But it the tool finishes running before any NSDistributedNotifications are received. Do I have to do something with NSRunLoop to receive the notifications?

Yes, you'll need to run the runloop.

Thanks, but I'm still not getting it. Does there have to be anything special done with the runloop mode, or ports?

Here is the main() of my app. I have putting calls to [[NSRunLoop currentRunLoop] run] both within the -scan method and at the end of my main() function.

#import <Cocoa/Cocoa.h>
#import "SlackerMinder.h"

int main (int argc, const char * argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
SlackerMinder *minder = [[SlackerMinder alloc] init];
[[NSDistributedNotificationCenter defaultCenter] addObserver: minder
selector: @selector(slackerLaunchedNotification:)
name: MLSlackerLaunchedNotification
object: nil];
int retval = [minder scan]; // Slacker.app may be launched here
[minder release];
[pool release];
return retval;
}

Alex Rice <email@hidden> | Mindlube Software | http://mindlube.com

what a waste of thumbs that are opposable
to make machines that are disposable Ani DiFranco
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSDistributedNotification in a Foundation tool
      • From: Alex Rice <email@hidden>
References: 
 >Re: NSDistributedNotification in a Foundation tool (From: Finlay Dobbie <email@hidden>)

  • Prev by Date: Re: Notes about WebCore
  • Next by Date: Re: Aqua Human Interface and Safari
  • Previous by thread: Re: NSDistributedNotification in a Foundation tool
  • Next by thread: Re: NSDistributedNotification in a Foundation tool
  • Index(es):
    • Date
    • Thread