11

How can i obtain the text of a UIButton in my

-(IBAction)clicked:(id)sender

method?

Thanks

joec
  • 3,533
  • 10
  • 60
  • 89

1 Answers1

43

What about this:

- (IBAction)clicked:(id)sender {
  UIButton *button = (UIButton *)sender; 
  NSString *buttonTitle = button.currentTitle;
}
Douwe Maan
  • 6,888
  • 2
  • 34
  • 35