Skip navigation.
 
mlRe: Inserting my own Responder before App?
FROM : Ken Thomases
DATE : Wed Apr 23 21:25:32 2008

On Apr 23, 2008, at 1:20 PM, Rick Mann wrote:
> My code currently inserts my controller between the app and whatever 
> the app is pointing to. (I don't know what happens if an app 
> delegate is installed after that.)
>
> I really need for my controller to be created at launch, but not its 
> window. I don't know if that's happening yet. But even though its 
> window may never be shown, it still needs to be there to support 
> other app operations, and to respond to the import action.


It seems like you're combining the role which might be called the 
"application controller" and a window controller.  If you are dealing 
with a window controller which has no window to control, then that 
smells like you're fighting the framework.

The app controller is usually just an instance of a custom class 
(subclassing from NSObject or whatever).  It is also usually set up as 
the application delegate.  You can even instantiate it in the main nib 
and hook up the File's Owner's delegate outlet to point to it.

Although the delegate comes after the application object in the 
responder chain, you don't typically care.  The application 
_delegates_ almost everything to its delegate.  :)  Well, everything 
which isn't completely generic.

This is the "normal" way for implementing custom application-global 
actions.  Implement them on the application delegate.

Cheers,
Ken

Related mailsAuthorDate
mlInserting my own Responder before App? Rick Mann Apr 23, 08:44
mlRe: Inserting my own Responder before App? Ken Thomases Apr 23, 09:37
mlRe: Inserting my own Responder before App? Rick Mann Apr 23, 09:46
mlRe: Inserting my own Responder before App? j o a r Apr 23, 10:01
mlRe: Inserting my own Responder before App? Manfred Schwind Apr 23, 10:02
mlRe: Inserting my own Responder before App? Cathy Shive Apr 23, 10:06
mlRe: Inserting my own Responder before App? Rick Mann Apr 23, 20:20
mlRe: Inserting my own Responder before App? Ken Thomases Apr 23, 21:25