Demonstrating how to implement programmatic creation of tabs in NSWindow
s without the use of NSDocument
.
- Checkout the
shared-window-controller
tag to see how to re-use a singleNSWindowController
for all tabs as per my experimental blog post. Don't use this in production, though. - Checkout the
multiple-window-controllers
tag or the currentmaster
branch to see how to manageNSWindowController
s for your tabs. I wrote about this production-ready approach, too.
The underlying difficulty people on StackOverflow etc. are experiencing is that creating your NSWindowController
from a storyboard will initialize the window contents, but you need to keep the window controller itself alive to respond to main menu actions. Otherwise, the "+" (add tab) button will appear broken for all but the initial tab.
Copyright (c) 2019--2021 Christian Tietze. Distributed under the MIT License.