Which button called the function?
Posted
by
StoneBreaker
on Stack Overflow
See other posts from Stack Overflow
or by StoneBreaker
Published on 2010-12-22T03:37:48Z
Indexed on
2010/12/22
3:54 UTC
Read the original article
Hit count: 199
I have two buttons which call the same function. That functions signature is
- (IBAction)eraseTextField {...}
I would like to figure out what button called the function. So I would like for the functions signature to be something like
- (IBAction)eraseTextField: (id)sender {...}
.
Is there a way for the system to know to send the id of the calling object to a function that it calls? Thanks for the help.
© Stack Overflow or respective owner