Get UIButton Text from sender
Pergunta
How can i obtain the text of a UIButton in my
-(IBAction)clicked:(id)sender
method?
Thanks
Solução
What about this:
- (IBAction)clicked:(id)sender {
UIButton *button = (UIButton *)sender;
NSString *buttonTitle = button.currentTitle;
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow