AppleEvents in Foundation tool (not working)
AppleEvents in Foundation tool (not working)
- Subject: AppleEvents in Foundation tool (not working)
- From: Allan Odgaard <email@hidden>
- Date: Sun, 7 Nov 2004 14:17:32 +0100
How can I receive apple events in a Foundation tool?
If I take a notify on
NSAppleEventManagerWillProcessFirstEventNotification it is never sent,
and if I setup a handler using
setEventHandler:andSelector:forEventClass:andEventID: the handler is
never called.
If I call NSApplicationMain() then the above does work, but I get this
error (four times):
Could not connect the action buttonPressed: to target of class
NSApplication
I have no nib in my application (so I do not know why it wants to
connect stuff).
A slightly related question, if I do a local event loop like this:
do {
isRunning = [[NSRunLoop currentRunLoop]
runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
} while(isRunning && !endRunLoop);
It seems my event handlers are not called during this event loop.
How can I do a local event loop and still have my event handlers called?
Basically what I want to do is to have a function called, and this
function should not return before a certain apple event has been
received.
My approach to this was to make it an ObjectiveC method, and have
instance methods which would receive the apple event and set a boolean
plus break the inner run-loop started in the method.
_______________________________________________
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