0

In this tutorial, I learned how to make a button say hello world in an OSX Cocoa application with Objective C, using XCode 7.

Now how do I make it call my tab view and make it switch a tab programmatically?

See, I'm implementing my interface with hidden tabs and when one clicks a button, it changes the tab. This is for an installer application I'm coding.

Community
  • 1
  • 1
Volomike
  • 23,743
  • 21
  • 113
  • 209

1 Answers1

2

Create an outlet in the AppDelegate and connect it to the tabview.

Create an action in the AppDelegate and connect the button to this action. Example (tabView is the outlet):

- (IBAction)selectMiddleTabViewItem:(id)sender {
    [self.tabView selectTabViewItemAtIndex:1];
}
Willeke
  • 14,578
  • 4
  • 19
  • 47
  • Phew! Thanks so much for your patience. I just knew that there had to be an easier way than the way I came up with. This worked! – Volomike Nov 30 '15 at 20:59