I am going to reorganize and reorganize my application at the moment. I realized that some of the sections between models and views, as well as their controllers, have shrunk, and I want to do some cleaning.
I have several key classes used in my application: NSPersistentDocument, NSWindowController, and model class.
The NSPersistentDocument class acts as a "controller model"; it has an instance of the model class and manages all interactions with the model.
The NSWindowController class acts as a "view controller"; he owns the main window and controls the interaction of the views in the main window. This class is also the file owner of the nib file in which the window is defined.
The problem that I see here is that I do not have a real "controller". My current design makes the model controller and view controller know about each other. There is no meditating object between them, and because of this, my model and view are not clearly separated, which makes the problem of multiple representations or models a problem.
I would like to move the functionality from both of my existing controllers to the new “controller” class, which will act as the controller between the model controller and the view controller. After all, this is still just an MVC design pattern, with a slightly larger structure.
However, it’s hard for me to understand how this will fit into the Cocoa-based application architecture.
: ?
Cocoa?
Cocoa, ?
.