Re: Cocoa in Carbon and NSNotifications
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