Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AppDelegate or AppController

While reading cocoa tutorials i've noticed that some of the tutorials use AppDelegate and some AppController for defining IBActions that open various windows that use subclasses of NSWindowController.

Is there some sort of rule of thumb for this?

like image 451
Eimantas Avatar asked Sep 13 '09 07:09

Eimantas


2 Answers

I create one class that is solely my app delegate, and instantiates my main controller (in applicationWillFinishLaunching:) and releases it (in applicationWillTerminate:). Then I have two classes with clearly-defined responsibilities: My main controller is the owner of the main window and the model, and the app delegate is nothing but the app delegate (and, as part of these duties, the owner of the main controller).

like image 96
Peter Hosey Avatar answered Sep 22 '22 14:09

Peter Hosey


It's just a class name. AppDelegate implies that the class's main duty is as NSApplication's delegate, whereas AppController seems to imply a broader range of responsibility.

like image 40
Chuck Avatar answered Sep 19 '22 14:09

Chuck