How do people typically implement dialog controllers?
How do people typically implement dialog controllers?
- Subject: How do people typically implement dialog controllers?
- From: Graham Cox <email@hidden>
- Date: Thu, 11 Sep 2008 12:48:11 +1000
OK, this is bit of a nebulous question, but I'm curious to know how
people are typically implementing controllers for dialog panels. I
don't mean the nuts and bolts of wiring up outlets to widgets and
implementing actions, but rather the further problem of managing all
the various bits of data. (i.e. the interface between the data model
and the controller). Let's assume we are talking about a traditional
non-bindings, non core-data model but where there are a substantial
number of related settings.
What I find I'm doing is collecting all the settings into a
dictionary, so effectively the dialog is an editor for that
dictionary. At some point the controller defers to a delegate within
the data model (or perhaps another controller) to get the dictionary
from the d/m when the dialog is loaded, and send a modified copy of
the dictionary back to the d/m when the dialog is OK'd. This is handy
in some ways - it makes implementing Cancel or Apply trivial for
example, and I have a bunch of dictionary utilities that streamline
the setting/getting of its values directly from UI controls.
But I do wonder if this is the most efficient way to do this, and
whether I haven't missed something more obvious.
cheers, Graham
_______________________________________________
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