I’ve created a tabView and am trying to put a custom view inside it. This tab is to serve as the model for tabs created afterwards. So, I tried this:
General/NSTabViewItem *item = General/[[NSTabView selectedTabViewItem] copy];
It seems that General/NSTabView does not conform to General/NSCopying. So I then tried.
General/NSTabViewItem *item = General/[[NSTabViewItem alloc] init]; [tabView addTabViewItem:item];
This didn’t copy the view inside the original General/NSTabViewItem to the new one. Finally, I tried:
[tabView addSubview:myView]; General/NSTabViewItem *item = General/[[NSTabViewItem alloc] init]; [tabView addTabViewItem:item];
The step I was missing was that I need to call [item setView:myView] after creating the tab. All’s fine now! – Hasan