When you implement your method using IBActions, the object that generated the message (sender) is passed to the message. Therefore, if I have a button on my interface that says โExitโ and an action on some controller object called logout: and I connected them, the method gets an instance of the button that called it. For instance:
- (void)logout:(id)sender { // sender is the instance of whichever wired button triggered // this action. We just NSLog() it for now. NSLog(@"-[%@ logout:%@]", self, sender); }
Other objects may also trigger this action and may convey themselves as a sender or may transmit zero. Details of this will be provided to you as a designer.
source share