Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Hour 10, “Declaring Methods in an Interface File,” covered the basics of declaring methods. There is a great deal of flexibility in the Objective-C method declaration structure, and you can use it to make your code easy to read and reuse (not to mention easy for users to use). In this hour, you learn how to create and use actions—a special type of method that is a key part of the Cocoa frameworks. Actions make it possible to connect interface elements such as buttons and menu commands to code that is triggered when the action is invoked by a user. In a very real sense, almost the entire user interface of Cocoa and Cocoa Touch rests on actions.
Without a doubt, actions are part of the Cocoa frameworks; however, they are implemented by writing Objective-C code, and their interactions with interface elements are created in most cases using Xcode. This hour shows you the basics of actions in both the frameworks and in the language contexts.