Define in the .h file

}
- (IBAction)myButtonPressed:(id)sender;
Create the function

- (IBAction)myButtonPressed:(id)sender
{
}

Connect In Interface Builder
Right click, select ‘Touch Up Inside’ and drag button onto ‘Files Owner’, select myMethodName

If you want to call the function from other code

	[self myButtonPressed:nil];