AppDelegate or AppController

When reading cocoa tutorials, I noticed that some tutorials use AppDelegate and some AppController to define IBActions that open various windows that use NSWindowController subclasses.

Is there any rule of thumb for this?

+6
model-view-controller cocoa delegates controller
source share
2 answers

This is just the name of the class. AppDelegate implies that the primary responsibility of the class is the NSApplication delegate, while AppController seems to imply a wider range of responsibilities.

+10
source share

I create one class, which is my only application delegate, and launches my main controller (in applicationWillFinishLaunching: and frees it (in applicationWillTerminate: . Then I have two classes with clearly defined responsibilities: my main controller is the owner of the main window and model, and the application delegate is nothing more than the application delegate (and, as part of these responsibilities, the owner of the main controller).

+11
source share

All Articles