Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
I want to have a bunch of buttons.

Why? That seems counter intuitive. Just use one button and programmatically have it change tabs for you.

Have you attempted any research on your own? Did you google "button perform action objective c"? There are literally thousands of tutorials on how to do what you're asking. A lot that break it down step by step.
 
OK, even with a bunch of buttons it wouldn't be too much different. One way would be to connect an outlet to each button, connect all of the buttons (or a group of buttons) to an action handler, and then have the handler do something like:

Code:
property button1 : missing value
property button2 : missing value
#
#

on myButtonHandler_(sender)
  if sender is button1 then
    myTabView's selectTabViewItemAtIndex_(1)
  else if sender is button2 then
    myTabView's selectTabViewItemAtIndex_(2)
  end if
end myButtonHandler

Instead of having a lot of outlets, you can also use the button (sender) names or tags, build a selector, etc, although if you have a bunch of buttons on each tab I think you are doing it wrong, unless these buttons are overlaying an image or something.

EDIT:
Sorry for the example (you were using AppleScriptObjC in your other topic), but the same thing applies in Objective-C.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.