Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding views or windows to MainWindow

Tags:

I'm stumbling over some basic concepts, that I cannot grasp. I hope, somebody can clear some things up for me, as I've found no resource, that would explain that. OR maybe, it's in the bright open and I just don't see it.

Understood so far: The MainWindow holds the menu and is therefore more or less essential. The info.plist holds the nib, that's loaded on appstart.

Not understood so far: I am trying a single window application. I can do everything in the appDelegate (works fine so far) and I can have an additional controller, to whcih I can connect UIElements from the MainWindow to (works although fine so far). BUT: What I'd really like to do, is have a MainWIndow, that only has the menu, and a separate controller and nib (possibly even more than one of both later on), that are loaded and added subsequently.

My questions:

  • Use NSWindowController or NSViewController? And why? (I'd use NSViewController)

  • What, where and how to instantiate (presumably in the didFinishLaunching of the appDelegate?)

  • How to add window or view to the one and only main-window instead of having a second, independent window (I'm not yet up for multiDocumentApps)

Thanx a lot, any thoughts appreciated!