How to select tabs for tabless NSTabViewController

301 views Asked by At

I have created sample NSTabViewController project.
I have added tab View Controller with 3 tab items. Then I have make tabview to tab less and switch tab with the help of three buttons.
I have take buttons actions in my main view controller.
I am selecting tabs using

[tabController setSelectedTabViewItemIndex:tag];
//tabController is NSTabController and Tag is selected tab index

Problem:Tab selection not changes with buttons.

1]

SSTabViewController *tabController = (SSTabViewController*) [self getController:@"SSTabViewController" WithStoryBoard:@"Main"];
selectedTabIndex = sender.tag;//i have set tags to buttons
[tabController setSelectedTabViewItemIndex:selectedTabIndex];


-(id) getController:(NSString*) controllerIdentifier WithStoryBoard:(NSString*) storyboradName
{
    NSStoryboard *storyboard = [NSStoryboard storyboardWithName:storyboradName bundle:[NSBundle mainBundle]];
    return [storyboard instantiateControllerWithIdentifier:controllerIdentifier];
}
0

There are 0 answers