This adds a viewport to the window:
NSTabView *tabView = [[[NSTabView alloc]
initWithFrame:NSMakeRect(10,10,300,300)] autorelease];
[[window contentView] addSubview:tabView];
This adds a tab to the tab view:
NSTabViewItem *item = [[[NSTabViewItem alloc]
initWithIdentifier:@"tab1"] autorelease];
[item setLabel:@"Tab 1"];
[tabView addTabViewItem:item];
At this point, you will want to add some controls to the tab. You must definitely do this using the interface. Create a tip with a view, make the owner of the NSViewController file. Then follow these steps:
NSViewController *viewController = [[[NSViewController alloc]
initWithNibName:@"myView" bundle:nil] autorelease];
[item setView:[viewController view]];
source
share