As for your first question, you do not need to use the main window that Apple provides in MainMenu.xib. If you want, you can remove this window from nib and then create an instance of NSWindowController in your delegate method applicationDidFinishLaunching: which then loads and controls the main window.
You are definitely confused about the NSViewController , which is not really surprising since you can assume that it works like a UIViewController .
In fact, NSViewController completely different from UIViewController and does not have the same level of support for Interface Builder. For example, you cannot place a view controller in a window in IB, whereas this is standard practice for iOS. NSViewController is a relatively new class on the Mac, and you usually use it to load views programmatically and manage the contents of the view.
The class closest to the Mac UIViewController NSWindowController . This was much longer than the NSViewController , and in fact, many Mac applications do not use the NSViewController at all.
As a rule, each window in your application should have a window controller that controls it. You can use NSWindowController subclasses to handle many functions for each window.
If you want to use the NSViewController , then you must use your window controller to manage these view controller objects. This is usually done programmatically due to the aforementioned lack of support for Interface Builder. Each instance of NSViewController loads its view from a specific nib file. Usually you do not add view controllers in Interface Builder.
For your source list, you usually use NSOutlineView if you have multiple sections or an NSTableView . These two objects are used whenever you need a list of items. NSOutlineView is hierarchical, while NSTableView is flat.
Hope this helps.
source share