IBAction is simply a marker for interface builder so that it knows what methods to provide connections for. If you look at in UINibDecleartions.h you will find
#ifndef IBAction
#define IBAction void
#endif
So no, you can do anything in code with IBAction. What you are looking for is probably something like
//Header
@interface SomeController : UIViewController {
NSInteger numTimesPressedButton;
}
-(IBAction)doSomething:(id)sender;
....
//.m File
- (id)initWithNibName:(NSString *)aNibName bundle:(NSBundle *)aNibBundle{
self = [super initWithNibName:aNibName bundle:aNibBundle];
if(self != nil)
{
numTimesPressedButton = 0;
...
}
return self;
}
-(IBAction)doSomething:(id)sender{
numTimesPressedButton++;
if (numTimesPressed > 3)
[someThing doSomeThingElse];
...
}