Re: Dynamically loading a part of a Window in Cocoa
Re: Dynamically loading a part of a Window in Cocoa
- Subject: Re: Dynamically loading a part of a Window in Cocoa
- From: Chris Hanson <email@hidden>
- Date: Thu, 02 Jul 2009 23:12:57 -0700
On Jul 1, 2009, at 8:18 PM, Marco S Hyman wrote:
On Jul 1, 2009, at 6:50 PM, Adam R. Maxwell wrote:
Well, I generally avoid bindings, since I can't comment nib/xib
files, and it takes too long to reverse engineer my own (or worse,
someone else's) bindings when I'm doing maintenance work. With
that perspective, the minor glue code to swap views is no big
deal :).
Warning: subject creep.
That leads directly to something I've been thinking about as one new
to cocoa:
how do you document your bindings? Any preferred formats other
than a text
file stuck somewhere in a project?
You can document bindings, as well as target-action and outlet
connections, by writing unit tests to specify them. You can even do
test-driven development of your xib files this way.
This can be as simple as writing tests that say “the value of the
table’s name column is bound to the Employees array controller’s
‘arrangedObjects.name’ property” and the creating the appropriate
bindings to make this test pass.
All of the information you need to test bindings can be easily found
using the -infoForBinding: method on any view or controller that
supports bindings. I’ve written some weblog posts on the topic:
Unit testing Cocoa user interfaces: Target-Action <http://eschatologist.net/blog/?p=10
>
Unit testing Cocoa user interfaces: Cocoa Bindings <http://eschatologist.net/blog/?p=12
>
These show how you might actually write some code to specify a
binding, or a target-action connection, in your application or
framework’s unit tests.
— Chris
_______________________________________________
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