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:

 ​ ​ ​ ​f​u​n​c​ ​s​e​n​d​A​c​t​i​o​n​(​_​:​ ​S​e​l​e​c​t​o​r​,​ ​t​o​:​ ​A​n​y​O​b​j​e​c​t​!​,​ ​f​r​o​m​:​ ​A​n​y​O​b​j​e​c​t​!​)​ ​-​>​ ​B​o​o​l​

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.