Actions are methods that are part of your controller class and are declared with a special keyword, IBAction. This keyword tells Interface Builder that this is an action and can be triggered by a control. In short if you want to have interface objects in the nib (like buttons) trigger methods in the controller class then you would use special methods called Actions.
Example declaration of an action method:
- (IBAction)doSomething:(id)sender;
- -(IBAction) = the return type
- doSomething: = name of the action
- (id) = argument
- sender; = argument name
The name of the action can be anything you want but must have a return type of IBAction, which is the same as declaring a return type of -(void). It just says that action methods do not return a value.
Usually an action method will take one argument and is typically defined as id and given a name of sender. (id)sender; is not always necessary when declaring an action method but is typically used all the time. The purpose of (id)sender; is to contain a reference to the control that has triggered the action method.