For the More Curious: Which Object Sends the Action Message?
The target on the Cut, Copy, and
Paste menu items is nil
.
Sending a message to nil
will not do anything.
All target-action messages are handled by NSApplication.
It has the following method:
func sendAction(_: Selector, to: AnyObject!, from: AnyObject!) -> Bool
When the target is nil
, NSApplication
knows to try to send messages to the objects in the responder chain.
Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.