views:

92

answers:

1

Hi,

Do events (i.e. -keyDown: and -keyUp:) follow the same responder chain as nil-targeted actions?

Thanks.

+2  A: 

Similar, but not the same. See the Apple Conceptual Guide on Event Architecture at http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/EventOverview/EventArchitecture/EventArchitecture.html, especially the section "The Responder Chains"

In this section are two subsections, "Responder Chain For Event Messages" and "Responder Chain for Action Messages" that detail the two chains and the differences between them. There are too many differences to detail, but some include: 1) The responder chain for action messages includes both the key window and the main window when both are present. The responder chain for key events includes only the key window. 2) For event messages, the last things in the chain are NSWindow and a NSWindowController if present. For action messages, the last thing is NSApp and its delegate.