Re: sendAction:to:from: fails when application is in background
Re: sendAction:to:from: fails when application is in background
- Subject: Re: sendAction:to:from: fails when application is in background
- From: Erik Buck <email@hidden>
- Date: Fri, 3 Nov 2006 19:03:04 -0500
NSApplication sendAction:to:from: is using the responder chain to
determine the receiver of the action. When there is no key or main
window, the responder chain is very short and does not contain any
objects that are in windows.
NSApp is a synonym for [NSApplication sharedApplication] and it never
changes within your program. There is no mysterious interprocess
communication going on.
Using the responder chain to send messages "while processing a large
file" sounds like a very strange thing to do to me. What are you
really trying to do ?
Why don't you just get a pointer to the object to which you want to
send messages and send the messages directly ?
You could even use NSApplication's - (id)targetForAction:(SEL)
aSelector to initially find the object to which you will send
messages, but that method is presumably already being used by -
sendAction:to:from: and won't work well with a short responder chain
either.
_______________________________________________
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