6 ms·
In the Apple documentation for MVC, "controller" refers to a class that sits between the model and view. When data changes in the model, it updates the view; a
by alexjm 3y ago
In the Apple documentation for MVC, "controller" refers to a class that sits between the model and view. When data changes in the model, it updates the view; and when the user interacts with the view, it passes events to the model.
https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/MVC.html#//apple_ref/doc/uid/TP40008195-CH32-SW1 https://developer.apple.com/library/archive/documentation/Ge...
Elsewhere, the documentation contrasts the Cocoa and Smalltalk versions of MVC where all three pieces communicate directly:
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/CocoaDesignPatterns.html#//apple_ref/doc/uid/TP40002974-CH6-SW22 https://developer.apple.com/library/archive/documentation/Co...
Like you said, this separation means you can "drive" the same model through different UIs. That's one of the things I always thought was cool about AppleScript support -- the app exposes a different interface to the same model.