Search code examples
ioscocoa-touchibaction

What is the (id)sender for in -(IBAction)action:(id)sender;


Possible Duplicate:
Objective C: what is a “(id) sender”?

What is the (id)sender for in:

-(IBAction)action:(id)sender;

Thanks for your help!


Solution

  • It is whatever object has called the action method; e.g., a button.

    You can use the id to check which of a set of buttons called the action, for instance.