I am coming from iOS background and starting to learn Cocoa. On iOS unless we have multiple targets for iPad
and iPhone
I also come from iOS and started coding Mac apps a while ago, learning mostly from Apple's documentation.
My impression is that on the desktop, you almost never need NSViewController
s (one big exception would be a window with tabs and multiple views, like the GarageBand welcome screen).
Most of the time you have one NSWindowController
per window. Learn first the relation between NSWindow
and NSWindowController
(and NSDocument
, if you are making a document-based app).
Once you got that right, start experimenting with NSViewController
.
UPDATE: It seems that since the introduction of storyboards for mac apps too, Apple expects that most of the view presentation logic should be migrated from the older NSWindowController
to the newer NSViewController
, more in line with how an iOS app is structured. I am not very knowledgeable on exactly where to draw the line, or what kind of code should remain in the window controller (or whether it still needs to be subclassed at all).