views:

49

answers:

2

Hello,

I am building a mac application in cocoa and would like to know what is the message flow (method calls) when the user presses command+q. The app uses the document based architecture.

Thanks.

+1  A: 

It goes up the responder chain like every other key press. If the first responder cannot or does not want to handle it, it gets passed up to the next in line. Usually for that key combination, the NSApplication instance recognizes it, handles it and consumes it.

Marcus S. Zarra
+1  A: 

Apple explained this completely in WWDC 2010 session 145: http://developer.apple.com/videos/wwdc/2010/

You don't need to have attended WWDC to have access to it; the session videos are free to everybody with an ADC account this year.

Peter Hosey
Fantastic, I just watched it. Its exactly what I needed. Thanks.
David