-3

When we declare

-(IBAction) buttonPressed:(id)sender;

what exactly the IBAction is used for???

Samuel Liew
  • 76,741
  • 107
  • 159
  • 260
iPhone
  • 4,092
  • 3
  • 34
  • 58

5 Answers5

2

This is a duplicate question:

IBOutlet and IBAction

Also,

http://www.cocoadev.com/index.pl?IBAction

You could have found the answer by doing a simple search.

IBAction is used to connect a method to Interface Builder/the XIB file. They allow you to refer to the method in the Interface Builder/XIB file. It also results in void.

Community
  • 1
  • 1
Flipper
  • 2,589
  • 3
  • 24
  • 32
1

IBAction stands for void. It's just a constant used from IB to link events to methods

Manlio
  • 10,768
  • 9
  • 50
  • 79
0

Interface Builder Action. You can see this method in your interface builder and can assign it to some button click event.

yosh
  • 3,245
  • 7
  • 55
  • 84
0

It is used as a marker for Interface Builder to identify. It actually doesn't do anything in the code itself. I think it might be defined to be void* or something like that.

iandotkelly
  • 9,024
  • 8
  • 48
  • 67
0

IBAction : The type qualifier IBAction, which is used in place of the void return type, flags the declared method as an action so that Interface Builder is aware of it. For an action method to appear in Interface Builder, you first must declare it in a header file of the class whose instance is to receive the action message

You can refer: Cocoa application

nila
  • 3,223
  • 4
  • 18
  • 15