On May 28, 2013, at 10:01 , YT <y...@redwoodcontent.com> wrote:

> I did run a test and created a NEW Project and checked the box "Create a 
> Document-based App"
> AND no Controller files (.h,.m) were automatically generated. 

Actually, two controllers *were* generated:

1. The app delegate. This object has the role of a controller, even though it 
starts out with nothing to do. Its controller behavior comes from code you add 
to it, as necessary.

2. The NSDocument subclass. These objects are also controllers.

> Which leads to the general mechanical problem of how does one create 
> Controller files (.h,.m)?

A MVC controller is just an object that behaves like a controller. It doesn't 
have to have "controller" in its name to behave like a controller. It can be of 
any class, and the class you choose depends on what it's supposed to do.

Keep in mind that the MVC pattern is a very general pattern. A MVC "controller" 
is not the same as a "view controller". Putting this another way, a view 
controller is a kind of MVC controller, but not the only kind.

Similarly, a MVC "view" is not necessarily a view. Rather, it's a component of 
your app design that interacts with the user. It may be implemented as a 
window, or as a view, or as a window with a hierarchy of views, or something 
more complex.

Translating a MVC design pattern into an implementation is messier on the Mac 
than on iOS. That's because the objects used on the Mac grew up over time. 
iOS's UIViews and UIViewControllers were based on Mac concepts, but tried to 
unify the loose Mac architecture into something more consistent and rational.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to