views:

152

answers:

2

I'm working on creating an NSDocument-based app with tabs for documents. I have found that it wasn't really designed for this. Apple designed the architechture to allow multiple windows for a single document but not the other way around. I have it basically working but I have started to run into weird issues. For example, when a window is closed, the window controller is dealloc'd but not the tab bar inside the window.

About the only information I could find on the web is this super-sketchy code in a forum post:

http://www.idevapps.com/forum/showthread.php?t=6330

Any advice?

A: 

Well, if you're going to dig in and fundamentally alter the hierarchy of how NSDocumentController, NSDocument, and NSWindowController interact, you should probably first implement your app in the conventional manner to get your head around the document architecture.

NSResponder
I've read the Apple docs about the interactions between the different classes and feel like I have a decent understanding of the way things should work. I was just hoping I could find someone with experience to offer some suggestions.
stealthdragon
+1  A: 

This might help (Cocoadev.com wiki): DocumentBasedAppWithOneWindowForAllDocuments ... I can't vouch for it personally but it's been around for a few years.

Joshua Nozzi