• 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: Cocoa in Carbon and NSNotifications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa in Carbon and NSNotifications


  • Subject: Re: Cocoa in Carbon and NSNotifications
  • From: Rosyna <email@hidden>
  • Date: Sat, 25 Feb 2006 15:26:12 -0700

Application level events may not propagate to cocoa inside Carbon applications. If you register for the carbon events in kEventClassApplication those will be sent (since 10.3, IIRC), even if the application is Cocoa.

Ack, at 2/25/06, Tomas Franzén said:

I'm registering for the NSWorkspaceDidLaunchApplicationNotification notification in a Carbon app. The problem is that it's never triggered.
This is the code I'm using:


- (void)doTheStuff {
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(notificationFired:) name:NSWorkspaceDidLaunchApplicationNotification object:nil];
}


- (void)notificationFired:(NSNotification *)notification{
	NSLog(@"Yo!");
}

The notificationFired: method is never called. I've tried other notifications, and they don't work either. Is there something special I need to do first in order for this to work? I call +[NSApplication sharedApplication] to initialize AppKit, but that doesn't seem to make any difference. It works perfectly in my Cocoa apps, so I figure it has something to do with the fact that this is a Carbon app.

--


Sincerely, Rosyna Keller Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People

It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Cocoa in Carbon and NSNotifications (From: Tomas Franzén <email@hidden>)

  • Prev by Date: Re: Cocoa in Carbon and NSNotifications
  • Next by Date: Re: How does a binding know what it gets should be treated like an NSArray or not ? (Was: How to observe and bind (KVO/KVB) to a value generated at runtime..)
  • Previous by thread: Re: Cocoa in Carbon and NSNotifications
  • Next by thread: Problem using NSWorkspace to copy a package
  • Index(es):
    • Date
    • Thread