Cocoa in Carbon and NSNotifications
Cocoa in Carbon and NSNotifications
- Subject: Cocoa in Carbon and NSNotifications
- From: Tomas Franzén <email@hidden>
- Date: Sat, 25 Feb 2006 22:52:21 +0100
Hi,
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.
Thanks,
Tomas Franzén
Lighthead Software
http://www.lightheadsw.com/ _______________________________________________
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