Re: NSController: Connections vs Bindings
Re: NSController: Connections vs Bindings
- Subject: Re: NSController: Connections vs Bindings
- From: mmalcolm crawford <email@hidden>
- Date: Fri, 28 Jan 2005 19:36:42 -0800
On Jan 28, 2005, at 5:48 PM, Richard Patterson wrote:
Some examples connect a controller to its content with a connection;
others use bindings. Do these amount to the same thing? If not, how
do I know which is appropriate when?
The relationship is exactly the same as with any other binding.
A binding is "dynamic"; an outlet is "static".
You can set the controller's content directly. If you want to set a
different object to be the content, you have to set it directly again.
If you bind the controller's content, then if the property to which you
have bound the content changes, the controller's content is set to the
new property value.
Whichever is appropriate depends, then, on the circumstances and what
you want to achieve. One issue is likely to be the "reachability" of
the content object. You typically do not have an array instantiated in
IB. It's typically a property of the file's owner. You can't
therefore set an array controller's content outlet to point to that
array directly. You could set it in code... But you can establish a
binding more easily, and it has the advantage that if the array
instance variable changes, the array controller's content is
automatically set to be the new array...
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden