1

I'm trying to understand what the "App Controller" is in a document based application. Apple doesn't mention it here. In the book I'm reading (Cocoa Programming for Mac OS X fourth edition), the author creates an app controller for handling a NSWindowController subclass that acts as a prefernce window. The app controller is a direct subclass of NSObject, so it appears that this isn't some standard Cocoa class.

Is this what app controller does? Handling shared windows in a document based application? Does it do something else?

user3956212
  • 359
  • 2
  • 14

1 Answers1

0

[The AppController] is responsible for setting up all of the initial view controllers, the window and serving as the handler for OS<->Application messages.

This is taken from an answer to a similar question here.

TheDarkKnight
  • 27,181
  • 6
  • 55
  • 85
  • That sounds like the description of the app delegate of iOS applications. But doesn't the `NSDocumentController` handle all the windows (via `NSDocument` of course)? And OS<->Application is, as far as I know, handled by the app delegate? If it is convention to have the app controller serve as the app delegate (as it says in the link), what more does the app controller do (in OS X)? – user3956212 Aug 20 '14 at 12:42
  • 1
    Of course you're right! After having read a little more, what you say makes sense to me. I think these links are useful: http://stackoverflow.com/questions/1417105/appdelegate-or-appcontroller and http://www.cocoabuilder.com/archive/cocoa/217223-appcontroller-vs-coredata-appdelegate.html – user3956212 Aug 20 '14 at 13:42