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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to