Of course the coupling is undesirable, but as far as I know, Cocoa
offers me
NO WAY to change that number of controls in a nib without changing
code in
my controller. (And it certainly doesn't offer me a path to add
controls
without remembering to connect them all properly.)
It does: You can use bindings, or you can create your own bindings-
like system that uses key paths and your own controller objects to
connect your view with your model.
You call out checking groups of controls for valid data as a
significant use case; you have said you don't want to write redundant
code to do this. I would probably use bindings to connect my view
and model objects, and implement key-value validation methods on my
model objects as appropriate. That way the validation is happening
at the model rather than the view level, and code-level coupling of
view and model is minimized.
For one example, if I was going to present identical controls for
several objects in a collection, I might create a custom view that
knew how to interact with an array controller and present one set of
controls for each object in the array controller's arranged objects.
-- Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden