Connecting Multiple Buttons to one action?

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-04-07T02:09:36Z Indexed on 2010/04/07 2:13 UTC
Read the original article Hit count: 553

Filed under:
|
|

Hello,

I have multiple UIButtons in my app. I also use interfacebuilder. In my .h i have something like this

IBOutlet UIButton *button1; IBOutlet UIButton *button2; IBOutlet UIButton *button3; - (IBAction)buttonPressed;

Then In my m i want to do something like this

  • (IBAction)buttonPressed { if (theButtonIpressed == button1) {

}

}

The problem is I don't have something called "theButtonIpressed" so I cant do this. What should my if statement look like?

Thanks, -David

© Stack Overflow or respective owner

Related posts about iphone

Related posts about SDK