Re: First responder design question. Are controllers in the chain?
Re: First responder design question. Are controllers in the chain?
- Subject: Re: First responder design question. Are controllers in the chain?
- From: Seth Willits <email@hidden>
- Date: Thu, 11 Sep 2008 12:43:43 -0700
On Sep 11, 2008, at 7:59 AM, David wrote:
I've been conceptually thinking of the document as part of the model.
The first responder chain in the document architecture goes through
the view hierarchy and checks the document.
View -> Window -> Window Delegate -> Window Controller -> Document
NSDocument is a mixture of model/controller. It in itself obviously
isn't the model, but it does contain the model in one form or another
(as properties of itself, or with a reference to an explicit model
object).
It doesn't go through the
controllers. I'm not sure how it would even know about them.
Right. It doesn't know about them. The only controller it does know
about is the window controller, but that's only if you have one (since
they're optional). It sounds like you don't have one right now. You
can add one, and put all of your controller code into there, to keep
the document as model-ish as possible.
The only problem is that your window controller can tend to get very
large. You can break it into subcontrollers (perhaps each one manages
a view, and is thus a "view" controller now), but none of them are in
the responder chain. You can add them to the chain after the window
controller yourself.
Here is a good way to do that:
http://katidev.com/blog/2008/04/09/nsviewcontroller-the-new-c-in-mvc-pt-1-of-3/
--
Seth Willits
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden